Merge branch 'master' into 'master'
Master add some feature 1.let user can modify the title's font 2.delete the verification for link 3.auto cover the template See merge request !1
This commit is contained in:
commit
ba809d79d3
|
|
@ -1,5 +1,4 @@
|
||||||
class TextMarqueesController < ApplicationController
|
class TextMarqueesController < ApplicationController
|
||||||
|
|
||||||
def widget
|
def widget
|
||||||
subpart = OrbitHelper.get_current_widget
|
subpart = OrbitHelper.get_current_widget
|
||||||
marquee = Marquee.find(OrbitHelper.widget_custom_value)
|
marquee = Marquee.find(OrbitHelper.widget_custom_value)
|
||||||
|
|
@ -7,7 +6,8 @@ class TextMarqueesController < ApplicationController
|
||||||
{
|
{
|
||||||
"text" => mqt.title,
|
"text" => mqt.title,
|
||||||
"speed" => mqt.speed,
|
"speed" => mqt.speed,
|
||||||
"url" => (mqt.url || "")
|
"url" => (mqt.url || ""),
|
||||||
|
"content" => (mqt.url.to_s.empty? ? "<a speed='#{mqt.speed}'>#{mqt.title}</a>" : "<a href='#{mqt.url}' target='_blank' speed='#{mqt.speed}'>#{mqt.title}</a>")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="<%= text.url %>" target="_blank"><%= text.title %></a>
|
<a href="<%= text.url %>" target="_blank"><%= text.title.html_safe %></a>
|
||||||
<div class="quick-edit">
|
<div class="quick-edit">
|
||||||
<ul class="nav nav-pills">
|
<ul class="nav nav-pills">
|
||||||
<% if can_edit_or_delete?(@marquee) %>
|
<% if can_edit_or_delete?(@marquee) %>
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
<label class="control-label muted"><%= t(:title) %></label>
|
<label class="control-label muted"><%= t(:title) %></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<%= f.fields_for :title_translations do |f| %>
|
<%= f.fields_for :title_translations do |f| %>
|
||||||
<%= f.text_field locale, class: "input-block-level", placeholder: t(:title), value: (@marquee_text.title_translations[locale] rescue nil) %>
|
<%= f.text_area locale, class: "ckeditor input-block-level", placeholder: t(:title), value: (@marquee_text.title_translations[locale] rescue nil) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -86,8 +86,4 @@
|
||||||
<%= link_to t('cancel'), admin_text_marquee_path(@marquee), :class=>"btn" %>
|
<%= link_to t('cancel'), admin_text_marquee_path(@marquee), :class=>"btn" %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
var formValidator = new FormValidator($("form.marquee_text_form"));
|
|
||||||
</script>
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
<div class="marquee-1" module="text_marquee" data-ps="">
|
||||||
|
<ul class="marquee" data-level="0" data-list="texts">
|
||||||
|
<li>{{content}}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function(){
|
||||||
|
var main_div = $("div[data-subpart-id={{subpart-id}}]"),
|
||||||
|
total_texts = main_div.find("ul li").length - 1,
|
||||||
|
current_text = 0,
|
||||||
|
last_text = 0;
|
||||||
|
|
||||||
|
main_div.find("ul li").hide();
|
||||||
|
var textTransform = function(){
|
||||||
|
current_text++;
|
||||||
|
current_text = (current_text > total_texts ? 0 : current_text);
|
||||||
|
last_text = (current_text == 0 ? total_texts : current_text - 1);
|
||||||
|
speed = $('.marquee > li > a').eq(current_text).attr('speed');
|
||||||
|
main_div.find("ul li").eq(last_text).slideUp(500);
|
||||||
|
main_div.find("ul li").eq(current_text).slideDown(500);
|
||||||
|
if(total_texts > 0){
|
||||||
|
setTimeout(textTransform,speed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setTimeout(textTransform,500);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function(){
|
||||||
|
var main_div = $("div[data-subpart-id"{{subpart-id}})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"widgets" : [
|
||||||
|
{
|
||||||
|
"filename" : "widget",
|
||||||
|
"name" : {
|
||||||
|
"zh_tw" : "跑馬燈",
|
||||||
|
"en" : "marquee"
|
||||||
|
},
|
||||||
|
"thumbnail" : "thumb.png"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
|
|
@ -2,7 +2,20 @@ $:.push File.expand_path("../lib", __FILE__)
|
||||||
|
|
||||||
# Maintain your gem's version:
|
# Maintain your gem's version:
|
||||||
require "text_marquee/version"
|
require "text_marquee/version"
|
||||||
|
app_path = File.expand_path(__dir__)
|
||||||
|
template_path = ENV['PWD'] + '/app/templates'
|
||||||
|
all_template = Dir.glob(template_path+'/*/')
|
||||||
|
puts 'copying module'
|
||||||
|
all_template.each do |folder|
|
||||||
|
if folder.split('/')[-1] != 'mobile'
|
||||||
|
begin
|
||||||
|
system ('cp -r '+ app_path + '/modules/ ' + folder)
|
||||||
|
rescue
|
||||||
|
puts 'error copy'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
system ('rm -r '+app_path + '/modules/')
|
||||||
# Describe your gem and declare its dependencies:
|
# Describe your gem and declare its dependencies:
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = "text_marquee"
|
s.name = "text_marquee"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue