update template

This commit is contained in:
rulingcom 2022-08-08 15:25:55 +08:00
parent ec501bce9f
commit 6d05aee356
69 changed files with 1511 additions and 223 deletions

View File

@ -226,7 +226,7 @@ body{
text-align: center; text-align: center;
color: #333333; color: #333333;
font-family: "Barlow", Sans-serif; font-family: "Barlow", Sans-serif;
font-size: 36px; font-size: 2em;
font-weight: 900; font-weight: 900;
text-transform: none; text-transform: none;
line-height: 40px; line-height: 40px;
@ -286,7 +286,7 @@ body{
flex: 3; flex: 3;
color: #666666; color: #666666;
font-family: "Barlow", Sans-serif; font-family: "Barlow", Sans-serif;
font-size: 36px; font-size: 2em;
font-weight: 900; font-weight: 900;
text-transform: none; text-transform: none;
height: 280px; height: 280px;

View File

@ -39,25 +39,23 @@
</ul> </ul>
</div> </div>
<script> <script>
var flag = 1; $('[data-subpart-id="{{subpart-id}}"] .pause-slide').click(function(){
$('.pause-slide').off('click').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('pause'); $(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('pause');
$(this).addClass('active') $(this).addClass('active')
$(this).parents('.controlplay').eq(0).find('.resume-slide').removeClass('active') $(this).parents('.controlplay').eq(0).find('.resume-slide').removeClass('active')
}); });
$('.resume-slide').off('click').click(function(){ $('[data-subpart-id="{{subpart-id}}"] .resume-slide').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('resume'); $(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('resume');
$(this).addClass('active') $(this).addClass('active')
$(this).parents('.controlplay').eq(0).find('.pause-slide').removeClass('active') $(this).parents('.controlplay').eq(0).find('.pause-slide').removeClass('active')
}); });
$('.next-button').off('click').on('click',function(){ $('[data-subpart-id="{{subpart-id}}"] .next-button').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("next"); $(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("next");
}) })
$('.prev-button').off('click').on('click',function(){ $('[data-subpart-id="{{subpart-id}}"] .prev-button').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("prev"); $(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("prev");
}) })
</script> </script>
<style type="text/css"> <style type="text/css">
.w-ba-banner .controlplay .resume-slide.active i{ .w-ba-banner .controlplay .resume-slide.active i{

View File

@ -32,7 +32,6 @@
<i class="fa fa-angle-right next-button" aria-label="<%= I18n.t("ad_banner.next") %>"></i> <i class="fa fa-angle-right next-button" aria-label="<%= I18n.t("ad_banner.next") %>"></i>
</ul> </ul>
</div> </div>
</div>
<script type="text/javascript"> <script type="text/javascript">
var ad_trigger_time; var ad_trigger_time;
if (typeof ad_banners_count === 'undefined'){ if (typeof ad_banners_count === 'undefined'){
@ -46,10 +45,11 @@
}else{ }else{
var audio_div; var audio_div;
if ($self.hasClass('have-audio')){ if ($self.hasClass('have-audio')){
audio_div = $('<button title="<%= I18n.t("ad_banner.muted") %>" class="jarallax-video-audio"><i class="fas fa-volume-up" aria-label="<%= I18n.t("ad_banner.muted") %>" aria-hidden="true"></i></button>'); audio_div = $('<button title="<%= I18n.t("ad_banner.muted") %>" class="jarallax-video-audio"><i class="fas fa-volume-up" aria-label="<%= I18n.t("ad_banner.muted") %>" aria-hidden="true"></i><p style=\"display: none;\"><%= I18n.t("ad_banner.muted") %></p></button>');
}else{ }else{
audio_div = $('<button title="<%= I18n.t("ad_banner.unmuted") %>" class="jarallax-video-audio"><i class="fas fa-volume-mute" aria-label="<%= I18n.t("ad_banner.unmuted") %>" aria-hidden="true"></i></button>'); audio_div = $('<button title="<%= I18n.t("ad_banner.unmuted") %>" class="jarallax-video-audio"><i class="fas fa-volume-mute" aria-label="<%= I18n.t("ad_banner.unmuted") %>" aria-hidden="true"></i><p style=\"display: none;\"><%= I18n.t("ad_banner.unmuted") %></p></button>');
} }
audio_div.find('p').css('display','none'); //fix CSP
audio_div.click(function(event) { audio_div.click(function(event) {
var currentTime = new Date(); var currentTime = new Date();
if (ad_trigger_time&&currentTime-ad_trigger_time<500){ if (ad_trigger_time&&currentTime-ad_trigger_time<500){
@ -88,11 +88,19 @@
var firstScriptTag = document.getElementsByTagName('script')[0]; var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
} }
$("*[data-yt-binded=0]").each(function(){ if(window.init_yt_banner == undefined){
$(this).attr("data-yt-binded","1"); function init_yt_banner(banner__slide){
var obj = $(this).find("iframe"); var $banner__slide = $(banner__slide);
obj.attr("id",$(this).data("youtube-id") + "_" + ad_banners_count); if( $banner__slide.data("yt-binded")== "0" ){
$banner__slide.data("yt-binded","1");
var obj = $banner__slide.find("iframe");
obj.attr("id", $banner__slide.data("youtube-id") + "_" + ad_banners_count);
ad_banners_count++; ad_banners_count++;
}
}
}
$("*[data-yt-binded=0]").each(function(){
init_yt_banner(this);
}) })
if (typeof onYouTubeIframeAPIReady !== 'function'){ if (typeof onYouTubeIframeAPIReady !== 'function'){
$(document).ready(function() { $(document).ready(function() {
@ -102,11 +110,96 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){
}); });
if(window.yt_players == undefined) if(window.yt_players == undefined)
window.yt_players = {}; window.yt_players = {};
function find_out_yt_event_list_key(yt_player){
var defalt_key = 'o';
var all_keys = Object.keys(yt_player).filter(function(s){return s.length == 1});
var prop_nums_thresh = 6;
if(all_keys.indexOf(defalt_key) != -1){
if((yt_player[defalt_key] instanceof Object) && Object.keys(yt_player[defalt_key]).length > prop_nums_thresh){
return defalt_key;
}
}
var event_key;
all_keys.forEach(function(k){
if((yt_player[k] instanceof Object) && Object.keys(yt_player[k]).length > prop_nums_thresh){
event_key = k;
return false;
}
})
return event_key;
}
function find_out_yt_event_list_count_key(yt_player, event_list_key){
var defalt_key = 'v';
var all_keys = Object.keys(yt_player).filter(function(s){return s.length == 1});
var equal_count = yt_player[event_list_key].length;
if(all_keys.indexOf(defalt_key) != -1){
if(yt_player[defalt_key] == equal_count){
return defalt_key;
}
}
var count_key;
all_keys.forEach(function(k){
if(yt_player[k] == equal_count){
count_key = k;
return false;
}
})
return count_key;
}
function find_out_yt_event_list_array_key(event_dict){
var defalt_key = 'i';
var all_keys = Object.keys(event_dict);
if(all_keys.indexOf(defalt_key) != -1){
var tmp = event_dict[defalt_key];
if(Array.isArray(tmp) && tmp.indexOf('onStateChange') != -1){
return defalt_key;
}
}
var array_key;
all_keys.forEach(function(k){
var tmp = event_dict[k];
if(Array.isArray(tmp) && tmp.indexOf('onStateChange') != -1){
array_key = k;
return false;
}
})
return array_key;
}
function find_out_yt_event_relation_key(event_dict, is_obj){ // is_obj = true => store event idx array. false => store whether event init(true or false)
var defalt_key = 'j';
var all_keys = Object.keys(event_dict);
if(all_keys.indexOf(defalt_key) != -1){
var tmp = event_dict[defalt_key];
if((tmp instanceof Object) && tmp['onStateChange']){
if(!is_obj || (tmp['onStateChange'] instanceof Object)){
return defalt_key;
}
}
}
var relation_key;
all_keys.forEach(function(k){
var tmp = event_dict[k];
if((tmp instanceof Object) && tmp['onStateChange']){
if(!is_obj || (tmp['onStateChange'] instanceof Object)){
relation_key = k;
return false;
}
}
})
return relation_key;
}
function onYouTubeIframeAPIReady(){ function onYouTubeIframeAPIReady(){
$(".w-ba-banner").each(function(i,banner){ $(".w-ba-banner").on('cycle-post-initialize', function(){
var iframes = $(banner).find("iframe"); init_banner(this);
});
function init_banner(banner){
var $banner = $(banner);
$banner.find('.w-ad-banner__slide').each(function(j, banner__slide){
init_yt_banner(banner__slide);
})
var iframes = $banner.find("iframe");
if(iframes.length > 0){ if(iframes.length > 0){
var id = $(banner).attr("data-subpart-id"); var id = $banner.attr("data-subpart-id");
if(yt_players[id] == undefined) if(yt_players[id] == undefined)
yt_players[id] = {}; yt_players[id] = {};
var remove_ids = []; var remove_ids = [];
@ -121,28 +214,48 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){
delete yt_players[id][k]; delete yt_players[id][k];
}) })
iframes.each(function(i,iframe){ iframes.each(function(i,iframe){
var yt_id = $(iframe).attr("id");
var yt_player = yt_players[id][$(iframe).attr("id")]; var yt_player = yt_players[id][$(iframe).attr("id")];
if(yt_player){ if(yt_player){
}else{ }else{
yt_player = new YT.Player($(iframe).attr("id"), { yt_player = new YT.Player($(iframe).attr("id"), {
events: { events: {
'onReady': function(event){ 'onReady': function(event){
var height = $(event.target.getIframe()).height(); var yt_player = event.target;
var height = $(yt_player.getIframe()).height();
var banner_wrap = $(iframe).parents('.w-ba-banner__wrap').eq(0); var banner_wrap = $(iframe).parents('.w-ba-banner__wrap').eq(0);
var carousel_wrap = banner_wrap.find(".cycle-carousel-wrap");
if(carousel_wrap.length){
carousel_wrap.css("top","3em");
height += parseInt(carousel_wrap.css('font-size')) * 3;
}
banner_wrap.height(height).css({"padding-bottom":"","padding-top":""}); banner_wrap.height(height).css({"padding-bottom":"","padding-top":""});
banner_wrap.find(".cycle-carousel-wrap").css("top","3em"); var init_key = find_out_yt_event_relation_key(yt_player, false);
try{ if(init_key){
delete (event.target.B || event.target.H || event.target.I).onStateChange; delete yt_player[init_key].onStateChange;
}catch(e){console.log("{onReady: true, onStateChange: true} missing!")}; }
var onStateChange_idx = event.target.l.i.onStateChange; else{
console.log("{onReady: true, onStateChange: true} missing!");
}
var event_list_key = find_out_yt_event_list_key(yt_player);
if(event_list_key){
var event_dict = yt_player[event_list_key];
var array_key = find_out_yt_event_list_array_key(event_dict);
var count_key = find_out_yt_event_list_count_key(event_dict, array_key);
var relation_key = find_out_yt_event_relation_key(event_dict, true);
var onStateChange_idx = event_dict[relation_key].onStateChange;
onStateChange_idx.reverse(); onStateChange_idx.reverse();
var event_size = 3; var event_size = 3;
onStateChange_idx.forEach(function(start_idx){ onStateChange_idx.forEach(function(start_idx){
event.target.l.h.splice(start_idx,event_size); event_dict[array_key].splice(start_idx,event_size);
}); });
event.target.l.i.onStateChange = []; event_dict[relation_key].onStateChange = [];
event.target.l.s = event.target.l.h.length; event_dict[count_key] = event_dict[array_key].length;
event.target.addEventListener('onStateChange',onPlayerStateChange); yt_player.addEventListener('onStateChange',onPlayerStateChange);
banner_wrap.trigger('resize');
}else{
console.log("YT player changes its variables!")
}
{{extra_ready_script}} {{extra_ready_script}}
}, },
'onStateChange': onPlayerStateChange 'onStateChange': onPlayerStateChange
@ -153,21 +266,24 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){
} }
}) })
} }
}
$(".w-ba-banner").each(function(i,banner){
init_banner(banner);
}) })
} }
function onPlayerStateChange(event){ function onPlayerStateChange(event){
var iframe = $(event.target.h), var iframe = $(event.target.getIframe()),
cyclediv = iframe.parents("div.cycle-slideshow"); cyclediv = iframe.parents("div.cycle-slideshow");
var widget = cyclediv.parents('.ba-banner-widget-youtube'); var widget = cyclediv.parents('.ba-banner-widget-youtube');
if(event.data == YT.PlayerState.PLAYING || event.data == YT.PlayerState.BUFFERING){ if(event.data == YT.PlayerState.PLAYING || event.data == YT.PlayerState.BUFFERING){
cyclediv[0].need_resume = !(cyclediv.hasClass("cycle-paused")); cyclediv[0].need_resume = !(cyclediv.hasClass("cycle-paused"));
cyclediv.cycle("pause"); cyclediv.cycle("pause");
widget.find('.banner-pager,.controlplay,.button-mid,.ad-overlay').css('visibility','hidden') widget.find('.banner-pager,.controlplay,.button-mid,.ad-overlay,.banner-overlay').css('visibility','hidden')
ad_audio_button(iframe.parents(".w-ad-banner__slide").eq(0),false); ad_audio_button(iframe.parents(".w-ad-banner__slide").eq(0),false);
}else if(event.data == YT.PlayerState.UNSTARTED || event.data == YT.PlayerState.PAUSED || event.data == YT.PlayerState.ENDED){ }else if(event.data == YT.PlayerState.UNSTARTED || event.data == YT.PlayerState.PAUSED || event.data == YT.PlayerState.ENDED){
if(cyclediv[0].need_resume) if(cyclediv[0].need_resume)
cyclediv.cycle("resume"); cyclediv.cycle("resume");
widget.find('.banner-pager,.controlplay,.button-mid,.ad-overlay').css('visibility','') widget.find('.banner-pager,.controlplay,.button-mid,.ad-overlay,.banner-overlay').css('visibility','')
ad_audio_button(iframe.parents(".w-ad-banner__slide").eq(0),true); ad_audio_button(iframe.parents(".w-ad-banner__slide").eq(0),true);
} }
{{extra_state_chnage_script}} {{extra_state_chnage_script}}
@ -187,32 +303,33 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){
} }
}) })
banner_wrap.on('cycle-resumed',function(opts){ banner_wrap.on('cycle-resumed',function(opts){
if(!($(this).data('paused'))){
var controlplay = $(this).nextAll(".controlplay"); var controlplay = $(this).nextAll(".controlplay");
if(controlplay.length != 0){ if(controlplay.length != 0){
controlplay.find(".resume-slide").addClass("active"); controlplay.find(".resume-slide").addClass("active");
controlplay.find(".pause-slide").removeClass("active"); controlplay.find(".pause-slide").removeClass("active");
} }
}
}) })
/* /*
var height = opts.slides.filter('.active').height() || opts.slides.height(); var height = opts.slides.filter('.active').height() || opts.slides.height();
banner_wrap.height(height)*/ banner_wrap.height(height)*/
if(banner_wrap.find('.cycle-slide-active iframe').length != 0)
banner_wrap.css("padding-bottom",""); banner_wrap.css("padding-bottom","");
{{extra_document_ready_script}} {{extra_document_ready_script}}
$('.pause-slide').off('click').click(function(){ $('[data-subpart-id="{{subpart-id}}"] .pause-slide').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('pause'); $(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").data('paused', true).cycle('pause');
$(this).addClass('active'); $(this).addClass('active');
$(this).parents('.controlplay').eq(0).find('.resume-slide').removeClass('active'); $(this).parents('.controlplay').eq(0).find('.resume-slide').removeClass('active');
}); });
$('.resume-slide').off('click').click(function(){ $('[data-subpart-id="{{subpart-id}}"] .resume-slide').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle('resume'); $(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").data('paused', false).cycle('resume');
$(this).addClass('active'); $(this).addClass('active');
$(this).parents('.controlplay').eq(0).find('.pause-slide').removeClass('active'); $(this).parents('.controlplay').eq(0).find('.pause-slide').removeClass('active');
}); });
$('.next-button').off('click').on('click',function(){ $('[data-subpart-id="{{subpart-id}}"] .next-button').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("next"); $(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("next");
}) })
$('.prev-button').off('click').on('click',function(){ $('[data-subpart-id="{{subpart-id}}"] .prev-button').click(function(){
$(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("prev"); $(this).parent("ul").parent('.w-ba-banner').find(".cycle-slideshow").cycle("prev");
}) })
var resize_timeout_id; var resize_timeout_id;
@ -232,7 +349,7 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){
<style type="text/css"> <style type="text/css">
.jarallax-video-audio{ .jarallax-video-audio{
z-index: 201; z-index: 201;
font-size: 36px; font-size: 2em;
color: #FFF; color: #FFF;
text-align: center; text-align: center;
position: absolute; position: absolute;

View File

@ -0,0 +1,22 @@
<div class="w-annc widget-announcement-10">
<h3 class="w-annc__widget-title">
<span>{{widget-title}}</span>
</h3>
<ul class="w-annc__list" data-level="0" data-list="application_forms">
<li class="w-annc__item row">
<h4 class="w-annc__entry-title col-sm-9">
<span class="w-annc__status-wrap" data-list="statuses" data-level="1">
<span class="w-annc__status label status {{status-class}}">{{status}}</span>
</span>
<a class="w-annc__title" href="{{link_to_show}}">{{title}}</a>
</h4>
<span class="w-annc__postdate-wrap col-sm-3" date-format="%Y-%m-%d">
<i class="fa fa-calendar-o"></i>
<span class="w-annc__postdate">{{postdate}}</span>
</span>
</li>
</ul>
<div class="w-annc__more-wrap clearfix">
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}">Read more</a>
</div>
</div>

View File

@ -0,0 +1,22 @@
<div class="w-annc widget-announcement-11">
<h3 class="w-annc__widget-title">
<span>{{widget-title}}</span>
</h3>
<ul class="w-annc__list" data-level="0" data-list="application_forms">
<li class="w-annc__item row">
<span class="w-annc__postdate-wrap col-sm-3" date-format="%Y-%m-%d">
<i class="fa fa-calendar-o"></i>
<span class="w-annc__postdate">{{postdate}}</span>
</span>
<h4 class="w-annc__entry-title col-sm-9">
<span class="w-annc__status-wrap" data-list="statuses" data-level="1">
<span class="w-annc__status label status {{status-class}}">{{status}}</span>
</span>
<a class="w-annc__title" href="{{link_to_show}}">{{title}}</a>
</h4>
</li>
</ul>
<div class="w-annc__more-wrap clearfix">
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}">Read more</a>
</div>
</div>

View File

@ -0,0 +1,27 @@
<div class="w-annc widget-announcement-12">
<h3 class="w-annc__widget-title">
<span>{{widget-title}}</span>
</h3>
<table class="w-annc__table table">
<thead>
<tr>
<th class="w-annc__th w-annc__th--title">{{title-head}}</th>
<th class="w-annc__th w-annc__th--date">{{date-head}}</th>
</tr>
</thead>
<tbody data-level="0" data-list="application_forms">
<tr>
<td class="w-annc_content">
<span class="w-annc__status-wrap" data-list="statuses" data-level="1">
<span class="w-annc__status label status {{status-class}}">{{status}}</span>
</span>
<a class="w-annc__title" href="{{link_to_show}}">{{title}}</a>
</td>
<td class="w-annc__postdate" date-format="%Y-%m-%d">{{postdate}}</td>
</tr>
</tbody>
</table>
<div class="w-annc__more-wrap clearfix">
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}">Read more</a>
</div>
</div>

View File

@ -0,0 +1,27 @@
<div class="w-annc widget-announcement-13">
<h3 class="w-annc__widget-title">
<span>{{widget-title}}</span>
</h3>
<table class="w-annc__table table">
<thead>
<tr>
<th class="w-annc__th w-annc__th--date">{{date-head}}</th>
<th class="w-annc__th w-annc__th--title">{{title-head}}</th>
</tr>
</thead>
<tbody data-level="0" data-list="application_forms">
<tr>
<td class="w-annc__postdate" date-format="%Y-%m-%d">{{postdate}}</td>
<td class="w-annc_content">
<span class="w-annc__status-wrap" data-list="statuses" data-level="1">
<span class="w-annc__status label status {{status-class}}">{{status}}</span>
</span>
<a class="w-annc__title" href="{{link_to_show}}">{{title}}</a>
</td>
</tr>
</tbody>
</table>
<div class="w-annc__more-wrap clearfix">
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}">Read more</a>
</div>
</div>

View File

@ -0,0 +1,31 @@
<div class="w-annc widget-announcement-5">
<h3 class="w-annc__widget-title">
<span>{{widget-title}}</span>
</h3>
<ul class="w-annc__list row" data-level="0" data-list="application_forms">
<li class="w-annc__item">
<div class="w-annc__content-wrap">
<div class="w-annc__meta">
<span class="w-annc__postdate-wrap" date-format="%Y-%m-%d">
<i class="fa fa-calendar-o"></i>
<span class="w-annc__postdate">{{postdate}}</span>
</span>
<span class="w-annc__category-wrap">
<i class="fa fa-tasks"></i>
<span class="w-annc__category">{{category}}</span>
</span>
<span class="w-annc__status-wrap" data-list="statuses" data-level="1">
<span class="w-annc__status label status {{status-class}}">{{status}}</span>
</span>
</div>
<h4 class="w-annc__entry-title">
<a class="w-annc__title" href="{{link_to_show}}">{{title}}</a>
</h4>
<p class="w-annc__subtitle">{{subtitle}}</p>
</div>
</li>
</ul>
<div class="w-annc__more-wrap clearfix">
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}">Read more</a>
</div>
</div>

View File

@ -0,0 +1,26 @@
<div class="w-annc widget-announcement-6">
<h3 class="w-annc__widget-title">
<span>{{widget-title}}</span>
</h3>
<ul class="w-annc__list" data-level="0" data-list="application_forms">
<li class="w-annc__item row">
<span class="w-annc__category-wrap col-sm-2">
<i class="fa fa-tasks"></i>
<span class="w-annc__category">{{category}}</span>
</span>
<h4 class="w-annc__entry-title col-sm-8">
<span class="w-annc__status-wrap" data-list="statuses" data-level="1">
<span class="w-annc__status label status {{status-class}}">{{status}}</span>
</span>
<a class="w-annc__title" href="{{link_to_show}}">{{title}}</a>
</h4>
<span class="w-annc__postdate-wrap col-sm-2" date-format="%Y-%m-%d">
<i class="fa fa-calendar-o"></i>
<span class="w-annc__postdate">{{postdate}}</span>
</span>
</li>
</ul>
<div class="w-annc__more-wrap clearfix">
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}">Read more</a>
</div>
</div>

View File

@ -0,0 +1,26 @@
<div class="w-annc widget-announcement-7">
<h3 class="w-annc__widget-title">
<span>{{widget-title}}</span>
</h3>
<ul class="w-annc__list" data-level="0" data-list="application_forms">
<li class="w-annc__item row">
<span class="w-annc__postdate-wrap col-sm-2" date-format="%Y-%m-%d">
<i class="fa fa-calendar-o"></i>
<span class="w-annc__postdate">{{postdate}}</span>
</span>
<h4 class="w-annc__entry-title col-sm-8">
<span class="w-annc__status-wrap" data-list="statuses" data-level="1">
<span class="w-annc__status label status {{status-class}}">{{status}}</span>
</span>
<a class="w-annc__title" href="{{link_to_show}}">{{title}}</a>
</h4>
<span class="w-annc__category-wrap col-sm-2">
<i class="fa fa-tasks"></i>
<span class="w-annc__category">{{category}}</span>
</span>
</li>
</ul>
<div class="w-annc__more-wrap clearfix">
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}">Read more</a>
</div>
</div>

View File

@ -0,0 +1,29 @@
<div class="w-annc widget-announcement-8">
<h3 class="w-annc__widget-title">
<span>{{widget-title}}</span>
</h3>
<table class="w-annc__table table">
<thead>
<tr>
<th class="w-annc__th w-annc__th--category">{{category-head}}</th>
<th class="w-annc__th w-annc__th--title">{{title-head}}</th>
<th class="w-annc__th w-annc__th--date">{{date-head}}</th>
</tr>
</thead>
<tbody data-level="0" data-list="application_forms">
<tr>
<td class="w-annc__category">{{category}}</td>
<td class="w-annc_content">
<span class="w-annc__status-wrap" data-list="statuses" data-level="1">
<span class="w-annc__status label status {{status-class}}">{{status}}</span>
</span>
<a class="w-annc__title" href="{{link_to_show}}">{{title}}</a>
</td>
<td class="w-annc__postdate" date-format="%Y-%m-%d">{{postdate}}</td>
</tr>
</tbody>
</table>
<div class="w-annc__more-wrap clearfix">
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}">Read more</a>
</div>
</div>

View File

@ -0,0 +1,29 @@
<div class="w-annc widget-announcement-9">
<h3 class="w-annc__widget-title">
<span>{{widget-title}}</span>
</h3>
<table class="w-annc__table table">
<thead>
<tr>
<th class="w-annc__th w-annc__th--date">{{date-head}}</th>
<th class="w-annc__th w-annc__th--title">{{title-head}}</th>
<th class="w-annc__th w-annc__th--category">{{category-head}}</th>
</tr>
</thead>
<tbody data-level="0" data-list="application_forms">
<tr>
<td class="w-annc__postdate" date-format="%Y-%m-%d">{{postdate}}</td>
<td class="w-annc_content">
<span class="w-annc__status-wrap" data-list="statuses" data-level="1">
<span class="w-annc__status label status {{status-class}}">{{status}}</span>
</span>
<a class="w-annc__title" href="{{link_to_show}}">{{title}}</a>
</td>
<td class="w-annc__category">{{category}}</td>
</tr>
</tbody>
</table>
<div class="w-annc__more-wrap clearfix">
<a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}">Read more</a>
</div>
</div>

View File

@ -0,0 +1,76 @@
{
"widgets": [
{
"filename": "application_form_widget5",
"name": {
"zh_tw": "5. 標準文字列表 ( 模組標題, 日期, 類別, 狀態, 標題, 副標題 )",
"en": "5. Standard Text List (widget-title, postdate, category, status, title, subtitle)"
},
"thumbnail": "application_form_widget5_thumbs.png"
},
{
"filename": "application_form_widget6",
"name": {
"zh_tw": "6. 標準標題列表-1 ( 模組標題, 類別, 狀態, 標題, 日期 )",
"en": "6. Standard Title List-1 (widget-title, category, status, title, postdate)"
},
"thumbnail": "application_form_widget6_thumbs.png"
},
{
"filename": "application_form_widget7",
"name": {
"zh_tw": "7. 標準標題列表-2 ( 模組標題, 日期, 狀態, 標題, 類別 )",
"en": "7. Standard Title List-2 (widget-title, postdate, status, title, category)"
},
"thumbnail": "application_form_widget7_thumbs.png"
},
{
"filename": "application_form_widget8",
"name": {
"zh_tw": "8. 標準表格列表-1 ( 模組標題, 類別, 狀態, 標題, 日期 )",
"en": "8. Standard Table List-1 (widget-title, category, status, title, postdate)"
},
"thumbnail": "application_form_widget8_thumbs.png"
},
{
"filename": "application_form_widget9",
"name": {
"zh_tw": "9. 標準表格列表-2 ( 模組標題, 日期, 狀態, 標題, 類別 )",
"en": "9. Standard Table List-2 (widget-title, postdate, status, title, category)"
},
"thumbnail": "application_form_widget9_thumbs.png"
},
{
"filename": "application_form_widget10",
"name": {
"zh_tw": "10. 精簡標題列表-1 ( 模組標題, 狀態, 標題, 日期 )",
"en": "10. Simple Title List-1 (widget-title, status, title, postdate)"
},
"thumbnail": "application_form_widget10_thumbs.png"
},
{
"filename": "application_form_widget11",
"name": {
"zh_tw": "11. 精簡標題列表-2 ( 模組標題, 日期, 狀態, 標題 )",
"en": "11. Simple Title List-2 (widget-title, postdate, status, title)"
},
"thumbnail": "application_form_widget11_thumbs.png"
},
{
"filename": "application_form_widget12",
"name": {
"zh_tw": "12. 精簡表格列表-1 ( 模組標題, 狀態, 標題, 日期 )",
"en": "12. Simple Table List (widget-title, status, title, postdate)"
},
"thumbnail": "application_form_widget12_thumbs.png"
},
{
"filename": "application_form_widget13",
"name": {
"zh_tw": "13. 精簡表格列表-2 ( 模組標題, 日期, 狀態, 標題 )",
"en": "13. Simple Table List (widget-title, postdate, status, title)"
},
"thumbnail": "application_form_widget13_thumbs.png"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -14,7 +14,7 @@
<dl class="i-archive__file-list" data-list="files" data-level="2"> <dl class="i-archive__file-list" data-list="files" data-level="2">
<dd class="i-archive__file-wrap"> <dd class="i-archive__file-wrap">
<a class="i-archive__file-name" href="{{file-url}}" target="_blank" title="{{file-name}}">{{file-name}}</a> <a class="i-archive__file-name" href="{{file-url}}" target="_blank" title="{{file-name}}">{{file-name}}</a>
<span class="i-archive__file-type label label-primary">{{file-type}}</span> <span class="i-archive__file-type label label-primary {{file-type}}">{{file-type}}</span>
</dd> </dd>
</dl> </dl>
</div> </div>

View File

@ -0,0 +1,38 @@
<div class="i-archive index-archive-2">
<h3 class="i-archive-title">
<span>{{page-title}}</span>
</h3>
<div class="panel-group" id="index-archive-group" data-list="categories" data-level="0">
<div class="panel panel-default">
<div class="panel-heading" style="padding: 0.625em 0.9375em;">
<h4 class="panel-title">
<i class="fa fa-file-text" aria-hidden="true"></i>
<a data-toggle="collapse" data-parent="#index-archive-group" href="#collapse" class="collapsed" style="padding: 0;display: inline-block;">
{{category-title}}
<i class="fa fa-chevron-down" aria-hidden="true"></i>
</a>
</h4>
</div>
<div id="collapse" class="panel-collapse collapse {{in_class}}">
<div class="panel-body">
<dl class="dl-horizontal i-archive-item-group" data-list="archives" data-level="1">
<dt class="i-archive-item-list">
<sapn class="i-archive-item-title">{{archive-title}}</span>
<span data-list="statuses" data-level="2">
<span class="label status {{status-class}}">{{status}}</span>
</span>
</dt>
<dl class="i-archive-files-list" data-list="files" data-level="2">
<dd>
<a href="{{file-url}}" class="i-archive-files-item" target="_blank" title="{{file-name}}">{{file-name}}</a>
<span class="label label-primary {{file-type}}">{{file-type}}</span>
</dd>
</dl>
</dl>
</div>
</div>
</div>
{{link_to_edit}}
</div>
</div>

View File

@ -0,0 +1,41 @@
<div class="i-archive index-archive-13">
<h3 class="i-archive-title">
<span>{{page-title}}</span>
</h3>
<ul class="archive-categories nav nav-tabs" role="tablist" data-list="categories" data-level="0" data-no-edit="true">
<li class="nav-item {{active_class}}" role="presentation">
<a href="#{{category-id}}" role="tab" data-toggle="tab" title="{{category-title}}" >{{category-title}}</a>
</li>
</ul>
<div class="tab-content" data-list="categories" data-level="0">
<div class="tab-pane {{active_class}}" id="{{category-id}}" role="tabpanel" aria-labelledby="{{category-id}}-tab">
<ul class="archives-ul" data-list="archives" data-level="1">
<li class="archive-li">
<p>
<span data-list="statuses" data-level="2">
<span class="label status {{status-class}}">{{status}}</span>
</span>
<a href="{{archive-file-url}}" target="_blank" title="{{archive-title}}">
{{archive-title}}
</a>
<span class="i-archive-files-list" data-list="files" data-level="2">
<a href="{{file-url}}" class="i-archive-files-item" title="{{file-name}}" data-toggle="tooltip" data-placement="bottom">
<span class="label label-primary {{file-type}}">{{file-type}}</span>
</a>
</span>
</p>
<div class="archive-description">{{description}}</div>
</li>
</ul>
{{link_to_edit}}
</div>
</div>
</div>
<style>
.index-archive-13 .archives-ul .archive-li{
list-style-type: disc;
}
.index-archive-13 .archive-description{
color: #9b9b9b;
}
</style>

View File

@ -13,7 +13,7 @@
<dl class="i-archive__file-list" data-list="files" data-level="2"> <dl class="i-archive__file-list" data-list="files" data-level="2">
<dd class="i-archive__file-wrap"> <dd class="i-archive__file-wrap">
<a class="i-archive__file-name" href="{{file-url}}" target="_blank" title="{{file-name}}">{{file-name}}</a> <a class="i-archive__file-name" href="{{file-url}}" target="_blank" title="{{file-name}}">{{file-name}}</a>
<span class="i-archive__file-type label label-primary">{{file-type}}</span> <span class="i-archive__file-type label label-primary {{file-type}}">{{file-type}}</span>
</dd> </dd>
</dl> </dl>
</div> </div>

View File

@ -87,6 +87,22 @@
"en": "11. Table list - Simple - Unfold Files (widget-title, category, Serial Number, filename, download link)" "en": "11. Table list - Simple - Unfold Files (widget-title, category, Serial Number, filename, download link)"
}, },
"thumbnail": "ar9.png" "thumbnail": "ar9.png"
},
{
"filename": "archive_index12",
"name": {
"zh_tw": "12. 手風琴式列表 - 有下拉 ( 模組標題, 類別標題, 檔案名稱, 下載連結 )",
"en": "12. Accordion list - with drop down (widget-title, category, filename, download link)"
},
"thumbnail": "ar2.png"
},
{
"filename": "archive_index13",
"name": {
"zh_tw": "13. 頁籤式 ( 模組標題, 類別標題, 標題, 檔案名稱, 下載連結, 描述 )",
"en": "13. Tab list (widget-title, category, title, filename, download link, description)"
},
"thumbnail": "ar-tab1.png"
} }
], ],
"widgets": [ "widgets": [

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -1,7 +1,7 @@
<div class="widget-ask widget1"> <div class="widget-ask widget1">
<style type="text/css"> <style type="text/css">
#new-ask-question .form-horizontal .control-group > *{ #new-ask-question .form-horizontal .control-group > *{
font-size: 1.2em; font-size: 1.125em;
} }
.default_picker label{ .default_picker label{
display: none; display: none;
@ -21,7 +21,7 @@
.ask-question .form-horizontal .control-label{ .ask-question .form-horizontal .control-label{
width: 24%; width: 24%;
max-width: 15em; max-width: 15em;
min-width: 14em; min-width: 7em;
padding: 0; padding: 0;
text-align: center; text-align: center;
} }
@ -32,15 +32,14 @@
overflow: hidden; overflow: hidden;
position: relative; position: relative;
min-width: 10em; min-width: 10em;
max-width: 20em; max-width: 25em;
padding-left: 0; padding-left: 0;
width: 70%; width: 100%;
padding: 0.5em; padding: 0.5em;
justify-content: center; justify-content: center;
} }
.ask-question .form-horizontal input[type="text"],.ask-question .form-horizontal select{ .ask-question .form-horizontal input[type="text"],.ask-question .form-horizontal select{
width: 97%; width: 97%;
max-width: 13.75em;
} }
.ask-question .form-horizontal .form-actions{ .ask-question .form-horizontal .form-actions{
position: relative; position: relative;
@ -51,9 +50,18 @@
<link href="/assets/custom_field.css" media="screen" rel="stylesheet"> <link href="/assets/custom_field.css" media="screen" rel="stylesheet">
<script src="/assets/validator"></script> <script src="/assets/validator"></script>
<link href="/assets/ask/ask.css" media="screen" rel="stylesheet"> <link href="/assets/ask/ask.css" media="screen" rel="stylesheet">
<h3 class="widget-title">
<span>{{widget-title}}</span>
</h3>
<div id="new-ask-question" class="ask-question">
{{switch_form}}
</div>
<script type='text/javascript'> <script type='text/javascript'>
$('#new-ask-question .required').each(function() { $('.ask-question .required').each(function() {
$(this).text('*' + $(this).text()); var text = $(this).text()
if (text[0]!='*'){
$(this).text('*' + text);
}
}); });
$(function(){ $(function(){
var fv = new FormValidator($("#new_ask_question")); var fv = new FormValidator($("#new_ask_question"));
@ -66,26 +74,38 @@
} }
} }
}) })
$(document).ready(function(){
function scrollIntoView(selector, offset = 0) {
window.scroll(0, document.querySelector(selector).offsetTop - offset);
}
var email_regex = "{{email_regex}}";
if(email_regex.length != 0){
email_regex = new RegExp(email_regex);
var submit_flag = false;
$(".ask-question-form").each(function(i, form){
var $form = $(form);
var email_field = $form.find('#ask_question_mail');
if($form.length != 0 && email_field.length != 0){
$form.submit(function(){
if(!submit_flag){
submit_flag = true;
if(email_regex.test(email_field.val())){
submit_flag = false;
}else{
email_field.css("border", "2px solid red");
scrollIntoView('#ask_question_mail');
alert("<%=t('ask.please_check_email_format')%>");
email_field.one("input",function(){
email_field.css("border", "");
})
submit_flag = false;
return false;
}
}
})
}
})
}
})
</script> </script>
<h3 class="widget-title">
<span>{{widget-title}}</span>
</h3>
<div id="new-ask-question" class="ask-question">
<form action="{{form_url}}" enctype="multipart/form-data" method="post" class="form-horizontal" accept-charset="UTF-8">
{{token_tag}}
<div data-level="0" data-list="fields">
<div class="control-group">
{{label}}
<div class="controls">
{{content}}
</div>
</div>
</div>
<div class="form-actions">
<input type="hidden" name="referer_url" value="{{referer_url}}">
{{submit_tag}}
{{close_tag}}
</div>
</form>
</div>
</div> </div>

View File

@ -14,4 +14,5 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div style="background: #337ab7; border: 1px solid rgb(204, 204, 204); padding: 5px 10px; text-align: right;"><span style="color:inherit;"><a href="{{more_href}}" title="{{more_title}}"><span style="color:#FFFFFF;">{{more_title}}</span></a></span></div>
</div> </div>

BIN
modules/calendar/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,63 @@
<div class="w-calendar widget-calendar-1" data-module="calendar">
<div class='month_template'>
<h4 class="widget-title ">
<span class="text"><span style="display: none;">placeholder</span></span>
<i class="fa fa-circle-o-notch fa-spin fa-fw loading hide"></i>
</h4>
<div class="w-calendar-nav">
<a href="#" class="w-calendar-nav-prev">
<i class="fa fa-chevron-left"></i>
<span class="w-calendar-nav-prev-text hide">Prev</span>
</a>
<a href="#" class="w-calendar-nav-next">
<i class="fa fa-chevron-right"></i>
<span class="w-calendar-nav-next-text hide">Next</span>
</a>
</div>
<table class="table table-condensed w-calendar-table">
<thead>
<tr data-list="week_title" data-level="0">
<th>{{week_title}}</th>
</tr>
</thead>
<tbody>
{{default_column}}
</tbody>
</table>
</div>
<div class="calendar-events" style="display: none;">
<div class="close_box">X</div>
<div class="event-header"></div>
<div class="event-containers">
</div>
</div>
</div>
<%= stylesheet_link_tag "calendar_widget1" %>
<script>
$(document).ready(function(){
if(document.getElementById("calendar-widget_module") == null){
var tag = document.createElement('script');
tag.setAttribute("id", "calendar-widget_module");
tag.src = "<%= asset_path('calendar_widget.js') %>";
tag.onload = function(){
$('div.widget-calendar-1[data-module=calendar][data-subpart-id="{{subpart-id}}"]').each(function(index){
var calendar = $(this),
cmi = new CalendarModuleMonth1(new Date(), calendar,calendar.data("subpart-id"),"{{more_url}}",false);
cmi.currentMonth();
calendar.find("div.w-calendar-nav a").on("click",function(){
var el = $(this);
if(el.hasClass("w-calendar-nav-prev")){
cmi.prevMonth();
}else if(el.hasClass("w-calendar-nav-next")){
cmi.nextMonth();
}
return false;
})
})
}
var head = document.getElementsByTagName("head");
head[0].appendChild(tag);
}
});
</script>

View File

@ -0,0 +1,79 @@
<div class="w-calendar widget-calendar-2" data-module="calendar">
<div class="w-calendar-title {{widget_title_class}}">
<span>{{calendar_title}}</span>
<span>{{widget_title}}</span>
</div>
<div class='month_template'>
<h4 class="widget-title">
<span class="text"><span style="display: none;">placeholder</span></span>
<i class="fa fa-circle-o-notch fa-spin fa-fw loading hide"></i>
</h4>
<div class="w-calendar-nav">
<a href="#" class="w-calendar-nav-prev">
<i class="fa fa-chevron-left"></i>
<span class="w-calendar-nav-prev-text hide">Prev</span>
</a>
<a href="#" class="w-calendar-nav-next">
<i class="fa fa-chevron-right"></i>
<span class="w-calendar-nav-next-text hide">Next</span>
</a>
</div>
<table class="table table-condensed w-calendar-table">
<thead>
<tr data-list="week_title" data-level="0">
<th>{{week_title}}</th>
</tr>
</thead>
<tbody>
{{default_column}}
</tbody>
</table>
</div>
<div class="calendar-events" style="display: none;">
<div class="event">
<div class="event-header">
<div class="date">
<div class="day"></div>
<div class="month"></div>
</div>
<div class="event-title">
<div class="event-inner-title"></div>
<div class="duration"></div>
</div>
</div>
<div class="event-wraper">
<div class="event-containers">
</div>
</div>
</div>
</div>
</div>
<%= stylesheet_link_tag "calendar_widget2" %>
<script>
$(document).ready(function(){
if(document.getElementById("calendar-widget_module2") == null){
var tag = document.createElement('script');
tag.setAttribute("id", "calendar-widget_module2");
tag.src = "<%= asset_path('calendar_widget2.js') %>";
tag.onload = function(){
$('div.widget-calendar-2[data-module="calendar"][data-subpart-id="{{subpart-id}}"]').each(function(index){
var calendar = $(this),
cmi = new CalendarModuleMonth2(new Date(), calendar,calendar.data("subpart-id"),"{{more_url}}",false);
cmi.currentMonth();
calendar.find("div.w-calendar-nav a").on("click",function(){
var el = $(this);
if(el.hasClass("w-calendar-nav-prev")){
cmi.prevMonth();
}else if(el.hasClass("w-calendar-nav-next")){
cmi.nextMonth();
}
return false;
})
})
}
var head = document.getElementsByTagName("head");
head[0].appendChild(tag);
}
});
</script>

View File

@ -0,0 +1,41 @@
<div id="orbit_calendar">
<div id="sec1">
<div class="btn-toolbar" id="navigation">
<div id="calendar-nav">
<div class="btn-group">
<button class="btn btn-default btn-sm" id="prev_month_btn">
<i class="icon-chevron-left"></i>
</button>
<button class="btn btn-default btn-sm" id="next_month_btn">
<i class="icon-chevron-right"></i>
</button>
<button class="btn btn-default btn-sm" id="today_btn"><%=t('calendar.today')%></button>
</div>
</div>
</div>
<div class="form-inline" id="range_selection"></div>
</div>
<div id='sec3' class="btn-toolbar">
<div class="btn-group calendar_mode">
<div data-list="modes_info" data-level="0">
<button class="btn btn-default mode_switch btn-sm {{active_class}}" data-mode="{{mode}}" >{{trans}}</button>
</div>
</div>
<button id="refresh_btn" class="btn btn-default btn-sm">
<i class="icons-cycle"></i>
</button>
</div>
<div id="view_holder">
<h3 id="current_title" class="current_day_title">
<span style="display: none;">placeholder</span>
</h3>
<div id="calendar"></div>
<div id="calendar_agenda"></div>
</div>
</div>
<div id="event_quick_view" class="modal" style="width: 300px; display:none; margin:0 0 0 0;"></div>
<div id="calendar-loading"></div>
<script type="text/javascript">
var calendar = new Calendar("#calendar","{{page_id}}");
</script>

View File

@ -0,0 +1,55 @@
<script type="text/javascript" src="<%= asset_path('calendar_widget.js') %>" id="calendar-index_module"></script>
{{style_tag}}
<div class="w-calendar widget-calendar-1 index2" data-module="calendar" data-page-id="{{page_id}}">
<div class='month_template'>
<h4 class="widget-title">
<span class="text"><span style="display: none;">placeholder</span></span>
<i class="fa fa-circle-o-notch fa-spin fa-fw loading hide"></i>
</h4>
<div class="w-calendar-nav">
<a href="#" class="w-calendar-nav-prev">
<i class="fa fa-chevron-left"></i>
<span class="w-calendar-nav-prev-text hide">Prev</span>
</a>
<a href="#" class="w-calendar-nav-next">
<i class="fa fa-chevron-right"></i>
<span class="w-calendar-nav-next-text hide">Next</span>
</a>
</div>
<table class="table table-condensed w-calendar-table">
<thead>
<tr data-list="week_title" data-level="0">
<th>{{week_title}}</th>
</tr>
</thead>
<tbody>
{{default_column}}
</tbody>
</table>
</div>
<div class="calendar-events" style="display: none;">
<div class="close_box">X</div>
<div class="event-header"></div>
<div class="event-containers">
</div>
</div>
</div>
<script>
$(document).ready(function(){
$("div.index2[data-module=calendar]").each(function(index){
var calendar = $(this),
cmi = new CalendarModuleMonth1(new Date(), calendar,calendar.data("page-id"),"",true);
cmi.currentMonth();
calendar.find("div.w-calendar-nav a").on("click",function(){
var el = $(this);
if(el.hasClass("w-calendar-nav-prev")){
cmi.prevMonth();
}else if(el.hasClass("w-calendar-nav-next")){
cmi.nextMonth();
}
return false;
})
})
})
</script>

View File

@ -0,0 +1,71 @@
<script type="text/javascript" src="<%= asset_path('calendar_widget2.js') %>" id="calendar-index_module2"></script>
{{style_tag}}
<div class="w-calendar widget-calendar-2 index3" data-module="calendar" data-page-id="{{page_id}}">
<div class="w-calendar-title {{widget_title_class}}">
<span>{{calendar_title}}</span>
<span>{{widget_title}}</span>
</div>
<div class='month_template'>
<h4 class="widget-title ">
<span class="text"><span style="display: none;">placeholder</span></span>
<i class="fa fa-circle-o-notch fa-spin fa-fw loading hide"></i>
</h4>
<div class="w-calendar-nav">
<a href="#" class="w-calendar-nav-prev">
<i class="fa fa-chevron-left"></i>
<span class="w-calendar-nav-prev-text hide">Prev</span>
</a>
<a href="#" class="w-calendar-nav-next">
<i class="fa fa-chevron-right"></i>
<span class="w-calendar-nav-next-text hide">Next</span>
</a>
</div>
<table class="table table-condensed w-calendar-table">
<thead>
<tr data-list="week_title" data-level="0">
<th>{{week_title}}</th>
</tr>
</thead>
<tbody>
{{default_column}}
</tbody>
</table>
</div>
<div class="calendar-events" style="display: none;">
<div class="event">
<div class="event-header">
<div class="date">
<div class="day"></div>
<div class="month"></div>
</div>
<div class="event-title">
<div class="event-inner-title"></div>
<div class="duration"></div>
</div>
</div>
<div class="event-wraper">
<div class="event-containers">
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$("div.index3[data-module=calendar]").each(function(index){
var calendar = $(this),
cmi = new CalendarModuleMonth2(new Date(), calendar,calendar.data("page-id"),"",true);
cmi.currentMonth();
calendar.find("div.w-calendar-nav a").on("click",function(){
var el = $(this);
if(el.hasClass("w-calendar-nav-prev")){
cmi.prevMonth();
}else if(el.hasClass("w-calendar-nav-next")){
cmi.nextMonth();
}
return false;
})
})
})
</script>

View File

@ -0,0 +1,46 @@
{
"frontend": [
{
"filename" : "index",
"name" : {
"zh_tw" : "1. 行事曆",
"en" : "1. Calendar"
},
"thumbnail" : "thumb.png"
},
{
"filename" : "index2",
"name" : {
"zh_tw" : "2. 行事曆(和widget樣式1同)",
"en" : "2. Calendar(same as widget style 1)"
},
"thumbnail" : "thumb.png"
},
{
"filename" : "index3",
"name" : {
"zh_tw" : "3. 行事曆加公告",
"en" : "3. Calendar with announcement"
},
"thumbnail" : "thumb.png"
}
],
"widgets" : [
{
"filename" : "calendar_widget1",
"name" : {
"zh_tw" : "1. 行事曆",
"en" : "1. Calendar"
},
"thumbnail" : "thumb.png"
},
{
"filename" : "calendar_widget2",
"name" : {
"zh_tw" : "2. 行事曆加公告",
"en" : "2. Calendar with announcement"
},
"thumbnail" : "thumb2.png"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -1,130 +1,161 @@
<div class="w-event_news widget-event_news-4 w-event_news widget-event_news-15" style="position:relative;"> <div class="w-annc widget-announcement-4 w-annc widget-announcement-15" style="position:relative;">
<div class="w-event_news__more-wrap clearfix"> <div class="w-annc__more-wrap clearfix">
<h2 class="w-event_news__widget-title"> <h2 class="w-annc__widget-title">
<span>{{widget-title}}</span> <span>{{widget-title}}</span>
</h2> </h2>
<a class="w-event_news__more btn btn-primary pull-right" href="{{more_url}}"><%= (I18n.locale.to_s =="zh_tw") ? "更多最新消息" : "More NEWS" %></a> <a class="w-annc__more btn btn-primary pull-right" href="{{more_url}}"><%= t("event_news.more") %></a>
</div> </div>
<div style="position: absolute;top: 50%;bottom: 50%;width:100%;"> <div style="position: absolute;top: 50%;bottom: 50%;width:100%;">
<button class="btn-left" title = "<%= (I18n.locale.to_s =="zh_tw") ? "上一張" : "prev" %>" style="float: left;height: 2.5em; width: 2.5em;background: url(/assets/left-01.png) no-repeat;border: 0;background-size: contain;position: absolute;transition:.3s; left: 0.6%;"></button> <button class="btn-left" title = "<%= (I18n.locale.to_s =="zh_tw") ? "上一張" : "prev" %>" style="float: left;height: 2.5em; width: 2.5em;background: url(/assets/left-01.png) no-repeat;border: 0;background-size: contain;position: absolute;transition:.3s; left: 0.6%;"></button>
<button class="btn-right" title = "<%= (I18n.locale.to_s =="zh_tw") ? "下一張" : "next" %>" style="float: right;;height: 2.5em; width: 2.5em;background: url(/assets/right-01.png) no-repeat;background-size: contain;border: 0;position: absolute;transition:.3s;right: 0.6%;"></button> <button class="btn-right" title = "<%= (I18n.locale.to_s =="zh_tw") ? "下一張" : "next" %>" style="float: right;;height: 2.5em; width: 2.5em;background: url(/assets/right-01.png) no-repeat;background-size: contain;border: 0;position: absolute;transition:.3s;right: 0.6%;"></button>
</div> </div>
<ul class="w-event_news__list row" data-level="0" data-list="event_news"> <ul class="w-annc__list row" data-level="0" data-list="event_news">
<li class="w-event_news__item col-md-4"> <li class="w-annc__item col-md-4">
<div class="w-event_news__img-wrap bullseye"> <div class="w-annc__img-wrap bullseye">
<img class="w-event_news__img" src="{{img_src}}" alt="{{img_description}}" title="{{img_description}}"> <img class="w-annc__img" src="{{img_src}}" alt="{{img_description}}" title="{{img_description}}">
</div> </div>
<div class="w-event_news__content-wrap"> <div class="w-annc__content-wrap">
<div class="w-event_news__meta"> <div class="w-annc__meta">
<span class="w-event_news__status-wrap" data-list="statuses" data-level="1"> <span class="w-annc__status-wrap" data-list="statuses" data-level="1">
<span class="w-event_news__status label {{status-class}}">{{status}}</span> <span class="w-annc__status label {{status-class}}">{{status}}</span>
</span> </span>
<span class="w-event_news__postdate-wrap" date-format="%Y-%m-%d"> <span class="w-annc__postdate-wrap" date-format="%Y-%m-%d">
<i class="fa fa-calendar-o"></i> <i class="fa fa-calendar-o"></i>
<span class="w-event_news__postdate">{{postdate}}</span> <span class="w-annc__postdate">{{postdate}}</span>
</span> </span>
<span class="w-event_news__category-wrap"> <span class="w-annc__category-wrap">
<i class="fa fa-tasks"></i> <i class="fa fa-tasks"></i>
<span class="w-event_news__category">{{category}}</span> <span class="w-annc__category">{{category}}</span>
</span> </span>
</div> </div>
<h4 class="w-event_news__entry-title"> <h4 class="w-annc__entry-title">
<a class="w-event_news__title" href="{{link_to_show}}">{{title}}</a> <a class="w-annc__title" href="{{link_to_show}}">{{title}}</a>
</h4> </h4>
<p class="w-event_news__subtitle">{{subtitle}}</p> <p class="w-annc__subtitle">{{subtitle}}</p>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script> <script>
function combineul(){ function combineul_{{subpart-id}}(){
for(var i=1;i<$('.widget-event_news-4 ul.w-event_news__list').length;i++) var parents = $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list').parent();
$('.widget-event_news-4 ul.w-event_news__list').eq(0).find('>li').eq(-1).after($('.widget-event_news-4 ul.w-event_news__list').eq(i).html()); parents.each(function(i,v){
var ullength = $('.widget-event_news-4 ul.w-event_news__list').length; for(var i=1;i<$(v).find('ul.w-annc__list').length;i++)
$(v).find('ul.w-annc__list').eq(0).find('>li').eq(-1).after($(v).find('ul.w-annc__list').eq(i).html());
var ullength = $(v).find('ul.w-annc__list').length;
for(var i = 1;i < ullength;i++) for(var i = 1;i < ullength;i++)
$('.widget-event_news-4 ul.w-event_news__list').eq(-1).remove(); $(v).find('ul.w-annc__list').eq(-1).remove();
})
}; };
var lilength = $('.widget-event_news-4 li.w-event_news__item').length;
var num; var num;
function reorganize(num){ var lilength = $('[data-subpart-id=\"{{subpart-id}}\"] li.w-annc__item').length;
combineul(); function reorganize_{{subpart-id}}(num){
for(var i=1;i< Math.ceil(lilength/num);i++){ var uls = $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list').toArray();
$('.widget-event_news-4 ul.w-event_news__list').eq(-1).after('<ul class="w-event_news__list row" data-level="0" data-list="event_news"></ul>') var currentul = uls.findIndex(function(v){
return $(v).hasClass("active") && !$(v).hasClass("hidden_item");
})
if(currentul == -1)
currentul = 0;
var li_active_idx = 0;
if(currentul != 0)
li_active_idx = $(uls[currentul]).find("li.w-annc__item").eq(0).index("li.w-annc__item");
combineul_{{subpart-id}}();
var parents = $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list').parent();
parents.each(function(i,v){
var lilength = $(v).find('li.w-annc__item').length;
var ul_length = Math.ceil(lilength/num);
for(var ii=1;ii< ul_length;ii++){
var clone_ul = $(v).find('ul.w-annc__list').eq(-1).clone();
clone_ul.empty();
clone_ul.removeClass("active");
clone_ul.css("display","");
$(v).find('ul.w-annc__list').eq(-1).after(clone_ul.prop("outerHTML"));
var lihtml=""; var lihtml="";
//var liheight=new Array(num); if(ii != (ul_length-1)){
if(i != (Math.ceil(lilength/num)-1)){
for(var j=0;j<num;j++){ for(var j=0;j<num;j++){
lihtml += "<li class='w-event_news__item col-md-4'>"+$('.widget-event_news-4 li.w-event_news__item').eq(i*num+j).html()+"</li>" lihtml += $(v).find('li.w-annc__item').eq(ii*num+j).prop("outerHTML");
//liheight[j] = $('.widget-event_news-4 li.w-event_news__item').eq(i*num+j).height()+20;//20=>margin-top+margin-bottom
}; };
}else{ }else{
for(var j=0;j< lilength - num *(Math.ceil(lilength/num)-1) ;j++){ for(var j=0;j< lilength - num *(ul_length-1) ;j++){
lihtml += "<li class='w-event_news__item col-md-4'>"+$('.widget-event_news-4 li.w-event_news__item').eq(i*num+j).html()+"</li>" lihtml += $(v).find('li.w-annc__item').eq(ii*num+j).prop("outerHTML");
//liheight[j] = $('.widget-event_news-4 li.w-event_news__item').eq(i*num+j).height()+20;//20=>margin-top+margin-bottom
}; };
}; };
$('.widget-event_news-4 ul.w-event_news__list').eq(-1).html(lihtml); $(v).find('ul.w-annc__list').eq(-1).html(lihtml);
}; }
if(Math.ceil(lilength/num) != 1 ) if(ul_length != 1 )
for(var i=0;i< lilength -num ; i++) for(var i=0;i< lilength -num ; i++)
$('.widget-event_news-4 ul.w-event_news__list').eq(0).find("li.w-event_news__item").eq(num).remove(); $(v).find('ul.w-annc__list').eq(0).find("li.w-annc__item").eq(num).remove();
for(var i=0;i< Math.ceil(lilength/num);i++) })
$('.widget-event_news-4 ul.w-event_news__list').eq(i).attr("index",i); $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list').css("display","none");
$('.widget-event_news-4 ul.w-event_news__list').css("display","none"); $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list').css('padding','0 1.125em');
$('.widget-event_news-4 ul.w-event_news__list').eq(0).css("display","flex"); $('[data-subpart-id=\"{{subpart-id}}\"] button').css('z-index','10');
$('.widget-event_news-4 ul.w-event_news__list').eq(0).addClass("active"); $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list >li').css('width','calc('+100/num+'% - '+20/16+'em)'); //20px=>li的margin
$('.widget-event_news-4 ul.w-event_news__list').css('padding','0 1.125em'); $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list >li').css('float','left');
$('.widget-event_news-4 button').css('z-index','10'); var active_ul = $("[data-subpart-id=\"{{subpart-id}}\"] li.w-annc__item").eq(li_active_idx).parents("ul.w-annc__list");
$('.widget-event_news-4 ul.w-event_news__list >li').css('width','calc('+100/num+'% - '+20/16+'em)'); //20px=>li的margin active_ul.addClass("active");
$('.widget-event_news-4 ul.w-event_news__list >li').css('float','left'); active_ul.removeClass("hidden_item");
active_ul.css("display","");
}; };
$(window).resize(function(){ $(window).resize(function(){
if($(window).width()>1024){ if($(window).width()>1024){
reorganize(3); reorganize_{{subpart-id}}(3);
num=3; num=3;
}else if($(window).width()>576){ }else if($(window).width()>576){
reorganize(2); reorganize_{{subpart-id}}(2);
num=2; num=2;
}else{ }else{
reorganize(1); reorganize_{{subpart-id}}(1);
num=1; num=1;
} }
}) })
$(document).ready(function(){ $(document).ready(function(){
if($(window).width()>1024){ if($(window).width()>1024){
reorganize(3); reorganize_{{subpart-id}}(3);
num=3; num=3;
}else if($(window).width()>576){ }else if($(window).width()>576){
reorganize(2); reorganize_{{subpart-id}}(2);
num=2; num=2;
}else{ }else{
reorganize(1); reorganize_{{subpart-id}}(1);
num=1; num=1;
} }
var flag=false; var flag=false;
$('.btn-left').click(function(){ $('.btn-left').click(function(){
if(!flag){ if(!flag){
var currentul = Number($('.widget-event_news-4 ul.w-event_news__list.active').attr("index")); var uls = $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list:not(.hidden_item)').toArray();
$('.widget-event_news-4 ul.w-event_news__list').css('display','none'); var ul_length = uls.length;
var currentul = uls.findIndex(function(v){
return $(v).hasClass("active");
})
$('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list').css('display','none');
if(currentul - 1 < 0) if(currentul - 1 < 0)
currentul += Math.ceil(lilength/num); currentul += ul_length;
$('.widget-event_news-4 ul.w-event_news__list').removeClass("active"); $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list:not(.hidden_item)').removeClass("active");
$('.widget-event_news-4 ul.w-event_news__list').eq(currentul-1).addClass("active"); var active_item = $(uls[currentul-1]);
active_item.addClass("active");
active_item.find("li").css("display","block");
flag=true; flag=true;
$('.widget-event_news-4 ul.w-event_news__list.active').eq(0).effect("slide", { direction: "left", mode: 'show', duration: 500},function(){flag=false;}); $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list.active').eq(0).effect("slide", { direction: "left", mode: 'show', duration: 500},function(){flag=false;});
}; };
}); });
$('.btn-right').click(function(){ $('.btn-right').click(function(){
var lilength = $('[data-subpart-id=\"{{subpart-id}}\"] li.w-annc__item').length;
if(!flag){ if(!flag){
var currentul = Number($('.widget-event_news-4 ul.w-event_news__list.active').attr("index")); var uls = $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list:not(.hidden_item)').toArray();
$('.widget-event_news-4 ul.w-event_news__list').css("display","none"); var ul_length = uls.length;
if(currentul + 1 > Math.ceil(lilength/num) - 1) var currentul = uls.findIndex(function(v){
currentul -= Math.ceil(lilength/num); return $(v).hasClass("active");
$('.widget-event_news-4 ul.w-event_news__list').removeClass("active"); })
$('.widget-event_news-4 ul.w-event_news__list').eq(currentul+1).addClass("active"); $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list').css('display','none');
if(currentul + 1 > ul_length - 1)
currentul -= ul_length;
$('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list:not(.hidden_item)').removeClass("active");
var active_item = $(uls[currentul+1]);
active_item.addClass("active");
active_item.find("li").css("display","block");
flag=true; flag=true;
$('.widget-event_news-4 ul.w-event_news__list.active').eq(0).effect("slide", { direction: "right", mode: 'show', duration: 500},function(){flag=false;}); $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list.active').eq(0).effect("slide", { direction: "right", mode: 'show', duration: 500},function(){flag=false;});
}; };
}); });
}); });

View File

@ -27,7 +27,7 @@
<a href="{{link_to_show}}" class="btn btn-secondary view "> <a href="{{link_to_show}}" class="btn btn-secondary view ">
<i class="fa fa-link" aria-hidden="true"></i> <i class="fa fa-link" aria-hidden="true"></i>
</a> </a>
<a href="{{src}}" data-toggle="lightbox" data-gallery="gallery" class="btn btn-secondary preview" data-title="{{alt_title}}" data-type="image"> <a href="{{src}}" data-toggle="lightbox" data-gallery="gallery" class="btn btn-secondary preview" data-title="{{alt_title}}" data-type="image" target="_blank">
<i class="fa fa-eye" aria-hidden="true"></i> <i class="fa fa-eye" aria-hidden="true"></i>
</a> </a>
</div> </div>

View File

@ -0,0 +1,174 @@
<div class="widget-link widget-3" style="position: relative;">
<div class="widget-link__more-wrap clearfix">
<h2 class="widget-link__widget-title">
<span>{{widget-title}}</span>
</h2>
</div>
<ul class="widget-link__list row" data-level="0" data-list="web_link" style="position:relative; z-index: 3">
<li class="widget-link__item col-md-3">
<div class="liWrapper">
<img class="widget-link__img" src="{{img_src}}" alt="{{img_description}}" title="{{img_description}}">
</div>
</li>
</ul>
<div style="position: absolute;top: 55%;bottom: 50%;width:100%;">
<button class="btn-left" title = "<%= (I18n.locale.to_s =="zh_tw") ? "上一張" : "prev" %>" style="float: left;height: 2.5em; width: 2.5em;background: url(/assets/link-left.png) no-repeat;border: 0;background-size: contain;position: absolute;transition:.3s; left: -1%;"></button>
<button class="btn-right" title = "<%= (I18n.locale.to_s =="zh_tw") ? "下一張" : "next" %>" style="float: right;;height: 2.5em; width: 2.5em;background: url(/assets/link-right.png) no-repeat;background-size: contain;border: 0;position: absolute;transition:.3s;right: -2%;"></button>
</div>
<a class="widget-link__more btn" href="{{more_url}}"><%= t("web_link.more") %></a>
</div>
<style>
ul.widget-link__list {
display: flex;
align-items: center;
justify-content: space-between;
}
.widget-3 li {
background-color: #fff;
padding: 3px;
min-height: 97px;
max-height: 97px;
}
.widget-link__more {
background-color: #811515;
font-size: 1.4em;
color: white !important;
display: block;
width: 200px;
text-align: center;
border-radius: 5px;
bottom: 8px;
margin: 50px auto 0 auto !important;
padding: 15px 10px;
}
.widget-link__more:hover {
background-color: #6b1111;
}
</style>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
function combineul_{{subpart-id}}(){
var parents = $('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list').parent();
parents.each(function(i,v){
for(var i=1;i<$(v).find('ul.widget-link__list').length;i++)
$(v).find('ul.widget-link__list').eq(0).find('>li').eq(-1).after($(v).find('ul.widget-link__list').eq(i).html());
var ullength = $(v).find('ul.widget-link__list').length;
for(var i = 1;i < ullength;i++)
$(v).find('ul.widget-link__list').eq(-1).remove();
})
};
var num;
var lilength = $('[data-subpart-id=\"{{subpart-id}}\"] li.widget-link__item').length;
function reorganize_{{subpart-id}}(num){
var uls = $('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list').toArray();
var currentul = uls.findIndex(function(v){
return $(v).hasClass("active") && !$(v).hasClass("hidden_item");
})
if(currentul == -1)
currentul = 0;
var li_active_idx = 0;
if(currentul != 0)
li_active_idx = $(uls[currentul]).find("li.widget-link__item").eq(0).index("li.widget-link__item");
combineul_{{subpart-id}}();
var parents = $('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list').parent();
parents.each(function(i,v){
var lilength = $(v).find('li.widget-link__item').length;
var ul_length = Math.ceil(lilength/num);
for(var ii=1;ii< ul_length;ii++){
var clone_ul = $(v).find('ul.widget-link__list').eq(-1).clone();
clone_ul.empty();
clone_ul.removeClass("active");
clone_ul.css("display","");
$(v).find('ul.widget-link__list').eq(-1).after(clone_ul.prop("outerHTML"));
var lihtml="";
if(ii != (ul_length-1)){
for(var j=0;j<num;j++){
lihtml += $(v).find('li.widget-link__item').eq(ii*num+j).prop("outerHTML");
};
}else{
for(var j=0;j< lilength - num *(ul_length-1) ;j++){
lihtml += $(v).find('li.widget-link__item').eq(ii*num+j).prop("outerHTML");
};
};
$(v).find('ul.widget-link__list').eq(-1).html(lihtml);
}
if(ul_length != 1 )
for(var i=0;i< lilength -num ; i++)
$(v).find('ul.widget-link__list').eq(0).find("li.widget-link__item").eq(num).remove();
})
$('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list').css("display","none");
$('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list').css('padding','0 1.125em');
$('[data-subpart-id=\"{{subpart-id}}\"] button').css('z-index','10');
$('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list >li').css('width','calc('+100/num+'% - '+20/16+'em)'); //20px=>li的margin
//$('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list >li').css('float','left');
var active_ul = $("[data-subpart-id=\"{{subpart-id}}\"] li.widget-link__item").eq(li_active_idx).parents("ul.widget-link__list");
active_ul.addClass("active");
active_ul.removeClass("hidden_item");
active_ul.css("display","");
};
$(window).resize(function(){
if($(window).width()>1024){
reorganize_{{subpart-id}}(4);
num=4;
}else if($(window).width()>576){
reorganize_{{subpart-id}}(2);
num=2;
}else{
reorganize_{{subpart-id}}(1);
num=1;
}
})
$(document).ready(function(){
if($(window).width()>1024){
reorganize_{{subpart-id}}(4);
num=4;
}else if($(window).width()>576){
reorganize_{{subpart-id}}(2);
num=2;
}else{
reorganize_{{subpart-id}}(1);
num=1;
}
var flag=false;
$('.btn-left').click(function(){
if(!flag){
var uls = $('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list:not(.hidden_item)').toArray();
var ul_length = uls.length;
var currentul = uls.findIndex(function(v){
return $(v).hasClass("active");
})
$('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list').css('display','none');
if(currentul - 1 < 0)
currentul += ul_length;
$('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list:not(.hidden_item)').removeClass("active");
var active_item = $(uls[currentul-1]);
active_item.addClass("active");
active_item.find("li").css("display","block");
flag=true;
$('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list.active').eq(0).effect("slide", { direction: "left", mode: 'show', duration: 500},function(){flag=false;});
};
});
$('.btn-right').click(function(){
var lilength = $('[data-subpart-id=\"{{subpart-id}}\"] li.widget-link__item').length;
if(!flag){
var uls = $('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list:not(.hidden_item)').toArray();
var ul_length = uls.length;
var currentul = uls.findIndex(function(v){
return $(v).hasClass("active");
})
$('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list').css('display','none');
if(currentul + 1 > ul_length - 1)
currentul -= ul_length;
$('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list:not(.hidden_item)').removeClass("active");
var active_item = $(uls[currentul+1]);
active_item.addClass("active");
active_item.find("li").css("display","block");
flag=true;
$('[data-subpart-id=\"{{subpart-id}}\"] ul.widget-link__list.active').eq(0).effect("slide", { direction: "left", mode: 'show', duration: 500},function(){flag=false;});
};
});
});
</script>

View File

@ -0,0 +1,49 @@
<div class="widget-link widget-4">
<div class="widget-link__more-wrap clearfix">
<h2 class="widget-link__widget-title">
<span>{{widget-title}}</span>
</h2>
</div>
<div class="widget-link_wrapper">
<div class="cycle-slideshow widget-content" style="margin: 0em 3.125em;"
data-level="0" data-list="web_link" data-cycle-slides="> li"
data-cycle-fx="carousel" data-cycle-timeout="0" data-cycle-carousel-visible="4" data-cycle-pause-on-hover="true" data-cycle-log="false" data-cycle-carousel-fluid="true">
<li class="widget-link__item">
<div class="liWrapper">
<img class="widget-link__img" src="{{img_src}}" alt="{{img_description}}" title="{{img_description}}">
</div>
</li>
</div>
<ul class="button-mid">
<i class="fa fa-angle-left prev-button" aria-label="<%= I18n.t("ad_banner.prev") %>"></i>
<i class="fa fa-angle-right next-button" aria-label="<%= I18n.t("ad_banner.next") %>"></i>
</ul>
</div>
</div>
<script>
$('[data-subpart-id="{{subpart-id}}"] .next-button').click(function(){
$(this).parent("ul").siblings('.widget-content').cycle("next");
})
$('[data-subpart-id="{{subpart-id}}"] .prev-button').click(function(){
$(this).parent("ul").siblings('.widget-content').cycle("prev");
})
</script>
<style type="text/css">
.widget-link_wrapper{
position: relative;
}
.widget-link.widget-4 .button-mid{
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.widget-link.widget-4 .button-mid .fa{
cursor: pointer;
}
</style>

View File

@ -0,0 +1,50 @@
<div class="widget-link widget-5">
<div class="widget-link__more-wrap clearfix">
<h2 class="widget-link__widget-title">
<span>{{widget-title}}</span>
</h2>
</div>
<div class="widget-link_wrapper">
<div class="cycle-slideshow widget-content" style="margin: 0em 3.125em;"
data-level="0" data-list="web_link" data-cycle-slides="> li"
data-cycle-fx="carousel" data-cycle-timeout="0" data-cycle-carousel-visible="5" data-cycle-pause-on-hover="true" data-cycle-log="false" data-cycle-carousel-fluid="true">
<li class="widget-link__item">
<div class="liWrapper">
<a class="widget-content-title" href="{{link_to_show}}" target="_blank" title="{{title_text}}">
<img class="widget-link__img" src="{{img_src}}" alt="{{img_description}}" title="{{img_description}}"><br />
{{title}}
</a>
</div>
</li>
</div>
<ul class="button-mid">
<i class="fa fa-angle-left prev-button" aria-label="<%= I18n.t("ad_banner.prev") %>"></i>
<i class="fa fa-angle-right next-button" aria-label="<%= I18n.t("ad_banner.next") %>"></i>
</ul>
</div>
</div>
<script>
$('[data-subpart-id="{{subpart-id}}"] .next-button').click(function(){
$(this).parent("ul").siblings('.widget-content').cycle("next");
})
$('[data-subpart-id="{{subpart-id}}"] .prev-button').click(function(){
$(this).parent("ul").siblings('.widget-content').cycle("prev");
})
</script>
<style type="text/css">
.widget-link_wrapper{
position: relative;
}
.widget-link.widget-5 .button-mid{
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.widget-link.widget-5 .button-mid .fa{
cursor: pointer;
}
</style>

View File

@ -0,0 +1,51 @@
<div class="widget-link widget-6">
<div class="widget-link__more-wrap clearfix">
<h2 class="widget-link__widget-title">
<span class="title">{{widget-title}}</span>
</h2>
</div>
<div class="widget-link_wrapper">
<div class="cycle-slideshow widget-content" style="margin: 0em 3.125em;"
data-level="0" data-list="web_link" data-cycle-slides="> li"
data-cycle-fx="carousel" data-cycle-timeout="0" data-cycle-carousel-visible="5" data-cycle-pause-on-hover="true" data-cycle-log="false" data-cycle-carousel-fluid="true">
<li class="widget-link__item">
<div class="liWrapper">
<a class="widget-content-title" href="{{link_to_show}}" target="_blank" title="{{title_text}}">
<img class="widget-link__img" src="{{img_src}}" alt="{{img_description}}" title="{{img_description}}"><br />
</a>
</div>
</li>
</div>
<ul class="button-mid">
<i class="fa fa-angle-left prev-button" aria-label="<%= I18n.t("ad_banner.prev") %>"></i>
<i class="fa fa-angle-right next-button" aria-label="<%= I18n.t("ad_banner.next") %>"></i>
</ul>
</div>
</div>
<script>
$('[data-subpart-id="{{subpart-id}}"] .next-button').click(function(){
$(this).parent("ul").siblings('.widget-content').cycle("next");
})
$('[data-subpart-id="{{subpart-id}}"] .prev-button').click(function(){
$(this).parent("ul").siblings('.widget-content').cycle("prev");
})
</script>
<style type="text/css">
.widget-link_wrapper{
position: relative;
}
.widget-link.widget-6 .button-mid{
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.widget-link.widget-6 .button-mid .fa{
cursor: pointer;
}
</style>

View File

@ -33,6 +33,38 @@
"en" : "2. Horizontal List (widget-title, link)" "en" : "2. Horizontal List (widget-title, link)"
}, },
"thumbnail" : "thumb.png" "thumbnail" : "thumb.png"
},
{
"filename" : "web_res_widget3",
"name" : {
"zh_tw" : "3. 輪播1(slide)",
"en" : "3. Banner 1(slide)"
},
"thumbnail" : "thumb.png"
},
{
"filename" : "web_res_widget4",
"name" : {
"zh_tw" : "4. 輪播2(carousel 4)",
"en" : "4. Banner 2(carousel 4)"
},
"thumbnail" : "thumb.png"
},
{
"filename" : "web_res_widget5",
"name" : {
"zh_tw" : "5. 輪播3(carousel 5)",
"en" : "5. Banner 3(carousel 5)"
},
"thumbnail" : "thumb.png"
},
{
"filename" : "web_res_widget6",
"name" : {
"zh_tw" : "6. 輪播4 - 僅有圖片,無標題(carousel 5)",
"en" : "6. Banner 4 - Only Images, No title(carousel 5)"
},
"thumbnail" : "thumb.png"
} }
] ]
} }