Merge remote-tracking branch 'remotes/origin/szzh' into develop
This commit is contained in:
commit
f20f0aaa45
|
@ -507,7 +507,7 @@ class UsersController < ApplicationController
|
|||
@user.password = @user.password_confirmation = nil
|
||||
|
||||
respond_to do |format|
|
||||
format.html { render :action => 'new' }
|
||||
format.html { render :action => 'new',:layout => "base" }
|
||||
format.api { render_validation_errors(@user) }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -335,7 +335,7 @@ module ApplicationHelper
|
|||
# set the project environment to please macros.
|
||||
@course = course
|
||||
if (ancestors.empty? )#|| course.is_descendant_of?(ancestors.last))
|
||||
s << "<ul class=courses'>\n"
|
||||
s << "<ul class=courses>\n"
|
||||
else
|
||||
ancestors.pop
|
||||
s << "</li>"
|
||||
|
|
|
@ -35,7 +35,7 @@ class Course < ActiveRecord::Base
|
|||
:delete_permission => :manage_files
|
||||
|
||||
validates_presence_of :password, :term,:name
|
||||
validates_format_of :class_period, :with =>/^[1-9]\d*$/
|
||||
validates_format_of :class_period, :with =>/^\d*$/
|
||||
#validates_format_of :name,:with =>/^[a-zA-Z0-9_\u4e00-\u9fa5]+$/
|
||||
|
||||
before_save :self_validate
|
||||
|
|
|
@ -564,10 +564,8 @@ class Issue < ActiveRecord::Base
|
|||
end
|
||||
# 缺陷的短描述信息
|
||||
def short_description(length = 255)
|
||||
# 不再使用短描述
|
||||
#description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||
description
|
||||
end
|
||||
|
||||
private :workflow_rule_by_attribute
|
||||
|
|
|
@ -76,10 +76,9 @@ class News < ActiveRecord::Base
|
|||
|
||||
# 新闻的短描述信息
|
||||
def short_description(length = 255)
|
||||
#description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||
# 不再使用短描述
|
||||
description
|
||||
#description
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -84,10 +84,10 @@ class OpenSourceProject < ActiveRecord::Base
|
|||
# end
|
||||
|
||||
def short_description(length = 255)
|
||||
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||
description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||
#description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
# 不再使用短描述
|
||||
description
|
||||
# description
|
||||
end
|
||||
|
||||
def applied_by?(user)
|
||||
|
|
|
@ -630,9 +630,7 @@ class Project < ActiveRecord::Base
|
|||
# Returns a short description of the projects (first lines)
|
||||
def short_description(length = 255)
|
||||
#description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
|
||||
# 不再使用短描述
|
||||
# description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
description
|
||||
description.gsub(/<\/?.*?>/,"").html_safe if description
|
||||
end
|
||||
|
||||
def css_classes
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<%= call_hook :view_account_login_top %>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<h3><%=l(:label_password_lost)%></h3>
|
||||
|
||||
<%= form_tag(lost_password_path) do %>
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<!-- added by bai 增加地区-->
|
||||
<script type="text/javascript" language="javascript">
|
||||
function showcity(province, cityField) {
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<%
|
||||
@nav_dispaly_contest_label = 1
|
||||
@nav_dispaly_store_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
%>
|
||||
<!-- fq -->
|
||||
<!-- modified by huang -->
|
||||
<div class="top-content">
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<%
|
||||
@nav_dispaly_contest_label = 1
|
||||
@nav_dispaly_store_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
%>
|
||||
<!-- fq -->
|
||||
<h3><%=l(:label_new_call)%></h3>
|
||||
|
||||
|
|
|
@ -87,72 +87,72 @@
|
|||
<div id="put-project-form" style="display: none; padding-left: 83px; width: 88%">
|
||||
<%= form_for Softapplication.new, :url => softapplications_path do |f| %>
|
||||
<fieldset class="contes-new-box" style="padding-left: 36px; line-height: 8px; margin-left: 1px" >
|
||||
<%= hidden_field_tag 'contest_id', @contest.id %>
|
||||
<tr style="width:700px; margin-left: -10px;">
|
||||
<span><%= l(:label_work_name) %></span>
|
||||
<span class="contest-star"> * </span>:
|
||||
<td><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
<span style="font-size: 10px">(<%= l(:label_workname_lengthlimit) %>)</span>
|
||||
</tr>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<%= hidden_field_tag 'contest_id', @contest.id %>
|
||||
<tr style="width:700px; margin-left: -10px;">
|
||||
<span><%= l(:label_work_name) %></span>
|
||||
<span class="contest-star"> * </span>:
|
||||
<td><%= f.text_field :name, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
<span style="font-size: 10px">(<%= l(:label_workname_lengthlimit) %>)</span>
|
||||
</tr>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<tr style="width:800px;">
|
||||
<span><%= l(:label_running_platform) %></span>
|
||||
<span class="contest-star"> * </span>:
|
||||
<td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
<tr style="width:800px;">
|
||||
<span><%= l(:label_running_platform) %></span>
|
||||
<span class="contest-star"> * </span>:
|
||||
<td style="width: 100px"><%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
|
||||
</tr>
|
||||
<br/>
|
||||
</tr>
|
||||
<br/>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<tr style="width:800px;">
|
||||
<span><%= l(:label_work_description) %></span>
|
||||
<span class="contest-star"> * </span>:
|
||||
<td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
<span style="font-size: 10px">(<%= l(:label_workdescription_lengthlimit) %>)</span>
|
||||
</tr>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<tr style="width:800px;">
|
||||
<span><%= l(:label_work_description) %></span>
|
||||
<span class="contest-star"> * </span>:
|
||||
<td style="width: 100px"><%= f.text_field :description, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
<span style="font-size: 10px">(<%= l(:label_workdescription_lengthlimit) %>)</span>
|
||||
</tr>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<tr style="width:800px;">
|
||||
<span><%= l(:label_softapplication_developers) %></span>
|
||||
<span class="contest-star"> * </span>:
|
||||
<td style="width: 100px"><%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
<tr style="width:800px;">
|
||||
<span><%= l(:label_softapplication_developers) %></span>
|
||||
<span class="contest-star"> * </span>:
|
||||
<td style="width: 100px"><%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:400px;" %></td>
|
||||
|
||||
</tr>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
</tr>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<tr style="width:800px;">
|
||||
<span><%= l(:label_work_deposit_project) %>:</span>
|
||||
<span style="padding-left: 4px"><%= select_tag 'project', options_for_select(select_option_helper(@option)), :name => 'project', :class => 'grayline2' %></span>
|
||||
<span><%= link_to l(:label_create_new_projects), new_project_path(course: 0, project_type: 0), :target => '_blank' %></span>
|
||||
</tr>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
<tr style="width:800px;">
|
||||
<span><%= l(:label_work_deposit_project) %>:</span>
|
||||
<span style="padding-left: 4px"><%= select_tag 'project', options_for_select(select_option_helper(@option)), :name => 'project', :class => 'grayline2' %></span>
|
||||
<span><%= link_to l(:label_create_new_projects),{:controller => 'projects',:action => 'new',course: 0, project_type: 0} , :target => '_blank',host:Setting.project_domain %></span><!-- new_project_path(course: 0, project_type: 0) -->
|
||||
</tr>
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<fieldset style="width: 500px; padding-top: 10px">
|
||||
<legend>
|
||||
<%= l(:label_upload_softworkpacket_photo) %>
|
||||
</legend>
|
||||
<%#= render_flash_messages %>
|
||||
<p id="put-bid-form-partial">
|
||||
<%= render :partial => 'attachments/form' %>
|
||||
</p>
|
||||
<fieldset style="width: 500px; padding-top: 10px">
|
||||
<legend>
|
||||
<%= l(:label_upload_softworkpacket_photo) %>
|
||||
</legend>
|
||||
<%#= render_flash_messages %>
|
||||
<p id="put-bid-form-partial">
|
||||
<%= render :partial => 'attachments/form' %>
|
||||
</p>
|
||||
|
||||
<p style="font-size: 11px">
|
||||
1、<%= l(:label_upload_softapplication_packets_mustpacketed) %> <br/>
|
||||
<br>
|
||||
2、<%= l(:label_upload_softapplication_photo_condition) %>
|
||||
</p>
|
||||
<p style="font-size: 11px">
|
||||
1、<%= l(:label_upload_softapplication_packets_mustpacketed) %> <br/>
|
||||
<br>
|
||||
2、<%= l(:label_upload_softapplication_photo_condition) %>
|
||||
</p>
|
||||
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
</fieldset></br>
|
||||
<div class="align-center" style="padding-top: -3px; padding-bottom: 8px">
|
||||
<%= submit_tag l(:button_create) %>
|
||||
|
@ -250,9 +250,9 @@
|
|||
<span style="padding-left: 240px"><strong><%= l(:label_attendingcontest_spoksman) %>
|
||||
<!-- modified by zjc 添加超链接 -->
|
||||
<% unless c_project.nil? || c_project.user.nil? %>
|
||||
:</strong><%= link_to c_project.user.name,user_path(c_project.user) %></span>
|
||||
:</strong><%= link_to c_project.user.name,user_path(c_project.user) %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="padding-left: 68px">
|
||||
|
||||
|
@ -287,9 +287,9 @@
|
|||
<span style="padding-left: 240px"><strong><%= l(:label_attendingcontest_spoksman) %>
|
||||
<!-- modified by zjc 添加超链接 -->
|
||||
<% unless c_softapplication.nil? || c_softapplication.softapplication.nil? || c_softapplication.softapplication.user.nil? %>
|
||||
:</strong><%= link_to c_softapplication.softapplication.user.name,user_path(c_softapplication.softapplication.user) %></span>
|
||||
:</strong><%= link_to c_softapplication.softapplication.user.name,user_path(c_softapplication.softapplication.user) %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--获奖及教师评奖-->
|
||||
<div style="padding-left: 18px; padding-bottom: 5px">
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
<% @nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_course_label = nil
|
||||
@nav_dispaly_store_all_label = 1 %>
|
||||
<%= labelled_form_for @course do |f| %>
|
||||
<h3><%=l(:label_course_new)%></h3>
|
||||
<div class="box tabular">
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<!-- added by fq -->
|
||||
<div class="top-content">
|
||||
<table width="940px">
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<!-- added by fq -->
|
||||
<h3><%= l :label_forum_new %></h1>
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
<% @nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_course_label = nil
|
||||
@nav_dispaly_store_all_label = 1 %>
|
||||
<script type="text/javascript">
|
||||
function switchTab(ProTag) {
|
||||
var display_index = 3 - ProTag;
|
||||
|
|
|
@ -2,29 +2,29 @@
|
|||
request.headers['REQUEST_URI'] = "" if request.headers['REQUEST_URI'].nil?
|
||||
realUrl = request.original_url
|
||||
if (realUrl.match(/.*forge\.trustie\.net\/*/))
|
||||
@nav_dispaly_project_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
#@nav_dispaly_project_label = 1
|
||||
#@nav_dispaly_forum_label = 1
|
||||
elsif (realUrl.match(/.*course\.trustie\.net\/*/))
|
||||
@nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_course_label = nil
|
||||
@nav_dispaly_store_all_label = 1
|
||||
#@nav_dispaly_course_all_label = 1
|
||||
#@nav_dispaly_forum_label = 1
|
||||
#@nav_dispaly_course_label = nil
|
||||
#@nav_dispaly_store_all_label = 1
|
||||
elsif (realUrl.match(/.*user\.trustie\.net\/*/))
|
||||
@nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1
|
||||
#@nav_dispaly_home_path_label = 1
|
||||
#@nav_dispaly_main_course_label = 1
|
||||
#@nav_dispaly_main_project_label = 1
|
||||
#@nav_dispaly_main_contest_label = 1
|
||||
elsif (realUrl.match(/.*contest\.trustie\.net\/*/))
|
||||
@nav_dispaly_contest_label = 1
|
||||
@nav_dispaly_store_all_label = 1
|
||||
#@nav_dispaly_contest_label = 1
|
||||
#@nav_dispaly_store_all_label = 1
|
||||
else
|
||||
@nav_dispaly_project_all_label = 1
|
||||
@nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_bid_label = 1
|
||||
@nav_dispaly_contest_label = 1
|
||||
@nav_dispaly_store_all_label = 1
|
||||
@nav_dispaly_user_label = 1
|
||||
#@nav_dispaly_project_all_label = 1
|
||||
#@nav_dispaly_course_all_label = 1
|
||||
#@nav_dispaly_forum_label = 1
|
||||
#@nav_dispaly_bid_label = 1
|
||||
#@nav_dispaly_contest_label = 1
|
||||
#@nav_dispaly_store_all_label = 1
|
||||
#@nav_dispaly_user_label = 1
|
||||
end
|
||||
%>
|
||||
<div id="top-menu" style="background-color: #15bccf;height:40px;margin-top: 10px;margin-bottom: 10px;">
|
||||
|
@ -45,7 +45,7 @@
|
|||
<ul class="course_sub_menu">
|
||||
<% User.current.courses.each do |course| %>
|
||||
<% if !course_endTime_timeout?(course) %>
|
||||
<li><%= link_to course.name.truncate(10, omission: '...'), {:controller => 'courses',:action => 'show',id:course.id} %></li>
|
||||
<li><%= link_to course.name.truncate(10, omission: '...'), {:controller => 'courses',:action => 'show',id:course.id, host: Setting.course_domain} %></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
@ -54,7 +54,7 @@
|
|||
<li id="project_loggedas_li"><%= link_to l(:label_my_projects), {:controller => 'users', :action => 'user_projects', id: User.current.id, host: Setting.project_domain} %>
|
||||
<ul class="project_sub_menu">
|
||||
<% User.current.projects.each do |project| %>
|
||||
<li><%= link_to project.name.truncate(10, omission: '...'), {:controller => 'projects', :action => 'show',id: project.id } %></li>
|
||||
<li><%= link_to project.name.truncate(10, omission: '...'), {:controller => 'projects', :action => 'show',id: project.id, host: Setting.project_domain } %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
<% @nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_course_label = nil
|
||||
@nav_dispaly_store_all_label = 1 %>
|
||||
<div class="top-content">
|
||||
<table>
|
||||
<tr>
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="<%= current_language %>">
|
||||
<head>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<% @nav_dispaly_bid_label = 1 %>
|
||||
|
||||
<% @nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_bid_label = 1 %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<% @nav_dispaly_contest_label = 1 %>
|
||||
<%
|
||||
@nav_dispaly_contest_label = 1
|
||||
@nav_dispaly_store_all_label = 1
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
@ -20,7 +23,7 @@
|
|||
<div id="wrapper">
|
||||
<div id="wrapper2">
|
||||
<div id="wrapper3">
|
||||
<%=render :partial => 'layouts/base_header'%>
|
||||
<%=render :partial => 'layouts/base_header'%>
|
||||
<div id="main" class="">
|
||||
<!-- added by bai -->
|
||||
<div class="top-content">
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<% @nav_dispaly_course_label = 1 %>
|
||||
<% @nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_course_label = nil
|
||||
@nav_dispaly_store_all_label = 1 %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<% @nav_dispaly_course_label = 1 %>
|
||||
<% @nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_course_label = nil
|
||||
@nav_dispaly_store_all_label = 1 %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<% @nav_dispaly_contest_label = 1 %>
|
||||
<%
|
||||
@nav_dispaly_contest_label = 1
|
||||
@nav_dispaly_store_all_label = 1
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
<% @nav_dispaly_project_label = 1
|
||||
@nav_dispaly_forum_label = 1 %>
|
||||
<% #@nav_dispaly_project_label = 1 %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<% @nav_dispaly_user_label = show_item_on_navbar(params) %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<!-- <h1>New memo</h1> -->
|
||||
<%= javascript_include_tag "ckeditor/ckeditor.js" %>
|
||||
<div class="top-content">
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(
|
||||
function () {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
<% @nav_dispaly_project_label = 1
|
||||
@nav_dispaly_forum_label = 1 %>
|
||||
<%= labelled_form_for @project do |f| %>
|
||||
<!--Added by young-->
|
||||
<% if @course_tag == '1' %>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580">
|
||||
<td colspan="2" width="580" style="word-break:break-all">
|
||||
<p class="font_description">
|
||||
<%= membership.course.short_description %>
|
||||
</p></td>
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<% memberships = user.memberships.all(:conditions => cond) %>
|
||||
<%= l(:label_x_contribute_to, :count => memberships.count) %>
|
||||
<% for member in memberships %>
|
||||
<%= link_to_project(member.project) %><%= (memberships.last == member) ? '' : ',' %>
|
||||
<%= link_to member.project.name, {:controller => 'projects', :action => 'show',id: member.project.id, host: Setting.project_domain } %><%= (memberships.last == member) ? '' : ',' %>
|
||||
<% end %>
|
||||
<p>
|
||||
<%# unless user.memberships.empty? %>
|
||||
|
@ -70,7 +70,7 @@
|
|||
<%= l(:label_x_course_contribute_to, :count => user_courses.count) %>
|
||||
<% for course in user_courses %>
|
||||
<%# if course.name != nil %>
|
||||
<%= link_to course.name,course_path(course) %><%= (user_courses.last == course) ? '' : ',' %>
|
||||
<%= link_to course.name,{:controller => 'courses',:action => 'show',id:course.id, host: Setting.course_domain} %><%= (user_courses.last == course) ? '' : ',' %>
|
||||
<%# end %>
|
||||
<% end %>
|
||||
<%# end %>
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<!-- modified by huang -->
|
||||
<script type="text/javascript">
|
||||
function searchUser(){
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<% @nav_dispaly_home_path_label = 1
|
||||
@nav_dispaly_main_course_label = 1
|
||||
@nav_dispaly_main_project_label = 1
|
||||
@nav_dispaly_main_contest_label = 1 %>
|
||||
<% @nav_dispaly_forum_label = 1%>
|
||||
<h3><%= link_to l(:label_user_plural), users_path %> » <%=l(:label_user_new)%></h3>
|
||||
|
||||
<%= labelled_form_for @user do |f| %>
|
||||
|
|
|
@ -37,32 +37,36 @@
|
|||
|
||||
<div class="autoscroll">
|
||||
<% if @users.size > 0 %>
|
||||
<% @users.each do |user| -%>
|
||||
<% unless user.id == 1%>
|
||||
<div class="well">
|
||||
<%= content_tag "p", "#{format_date(user.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
|
||||
<%= image_tag "/images/time_member.png", :class => "img_member_time"%>
|
||||
<div>
|
||||
<%= image_tag(url_to_avatar(user), :class => 'avatar') %>
|
||||
<%= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %>
|
||||
</div>
|
||||
<div style="margin-top: 20px;margin-left:66px">
|
||||
<%= l(:label_has_fans,:count=>user.watcher_users.count)%>
|
||||
<%= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
|
||||
</div>
|
||||
|
||||
<div class="user-bottom">
|
||||
<% unless user.memberships.empty? %>
|
||||
<%= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>
|
||||
<% for member in user.memberships %>
|
||||
<%= link_to_project(member.project) %><%= (user.memberships.last == member) ? '' : ',' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= user.changesets.count == 0 ? '' : ",#{l(:label_total_commit, :total_commit => user.changesets.count)}" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
<%= render :partial => 'user_show' %>
|
||||
|
||||
<!--
|
||||
<%# @users.each do |user| -%>
|
||||
<%# unless user.id == 1%>
|
||||
<div class="well">
|
||||
<%#= content_tag "p", "#{format_date(user.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
|
||||
<%#= image_tag "/images/time_member.png", :class => "img_member_time"%>
|
||||
<div>
|
||||
<%#= image_tag(url_to_avatar(user), :class => 'avatar') %>
|
||||
<%#= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %>
|
||||
</div>
|
||||
<div style="margin-top: 20px;margin-left:66px">
|
||||
<%#= l(:label_has_fans,:count=>user.watcher_users.count)%>
|
||||
<%#= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
|
||||
</div>
|
||||
|
||||
<div class="user-bottom">
|
||||
<%# unless user.memberships.empty? %>
|
||||
<%#= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>
|
||||
<%# for member in user.memberships %>
|
||||
<%#= link_to_project(member.project) %><%#= (user.memberships.last == member) ? '' : ',' %>
|
||||
<%# end %>
|
||||
<%# end %>
|
||||
<%#= user.changesets.count == 0 ? '' : ",#{l(:label_total_commit, :total_commit => user.changesets.count)}" %>
|
||||
</div>
|
||||
</div>
|
||||
<%# end -%>
|
||||
<%# end -%>
|
||||
-->
|
||||
<% else %>
|
||||
<%= render :partial => "layouts/no_content"%>
|
||||
<% end %>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<% if User.current.id == @user.id %>
|
||||
<div class="menu-div">
|
||||
<div class="menu">
|
||||
<span style="color: #000; font-weight: ;"><%= "#{@user.name}的动态" %></span>
|
||||
<span style="color: #000; font-weight: bold;"><%= "#{@user.name}的动态" %></span>
|
||||
<ul><%#链接绑定在页面最下方的jQuery%>
|
||||
<li mode='all' class="<%= "on" if @state.eql?(0) %>"><%= l :label_user_all_activity %></li>
|
||||
<li mode='myself' class="<%= "on" if @state.eql?(1) %>"><%= l :label_user_activity_myself %></li>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<span class="font_lighter"> <%= l(:label_peoject_take_in) %></span> <%= link_to_project(membership.project) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580" >
|
||||
<td colspan="2" width="580" style="word-break:break-all">
|
||||
<p class="font_description">
|
||||
<%= membership.project.short_description%>
|
||||
</p></td>
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
<%
|
||||
@nav_dispaly_contest_label = 1
|
||||
@nav_dispaly_store_all_label = 1
|
||||
%>
|
||||
<%= stylesheet_link_tag 'welcome' %>
|
||||
<script type="text/javascript" language="javascript">
|
||||
function clearInfo(id, content) {
|
||||
|
@ -166,7 +170,7 @@
|
|||
</div>
|
||||
|
||||
<div style="float: left;margin:5px; margin-left: 12px; margin-bottom: 2px; width: 380px;">
|
||||
<span class='font_lighter' title =<%=contest.description.to_s%>><%=contest.description.to_s%></span>
|
||||
<span class='font_lighter' title ='<%=contest.description%>'><%=contest.description.truncate(100, omission: '...')%></span>
|
||||
</div><br />
|
||||
|
||||
<div style="padding-left: 57px; clear: left;">
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
<% @nav_dispaly_course_all_label = 1
|
||||
@nav_dispaly_forum_label = 1
|
||||
@nav_dispaly_course_label = nil
|
||||
@nav_dispaly_store_all_label = 1 %>
|
||||
<%= stylesheet_link_tag 'welcome' %>
|
||||
<%= javascript_include_tag 'welcome' %>
|
||||
<script type="text/javascript" language="javascript" xmlns="http://www.w3.org/1999/html"
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
<% @nav_dispaly_project_label = 1
|
||||
@nav_dispaly_forum_label = 1 %>
|
||||
<%= stylesheet_link_tag 'welcome' %>
|
||||
<%= javascript_include_tag 'welcome' %>
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
@ -73,7 +75,7 @@
|
|||
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
|
||||
</div>
|
||||
<div style=" float: left;margin:5px; margin-left: 10px; width: 380px;">
|
||||
<span class='font_lighter' title =<%=project.description.to_s%>><%=project.description%></span>
|
||||
<span class='font_lighter' title ='<%=project.short_description%>'><%=project.description.truncate(100, omission: '...')%></span>
|
||||
</div>
|
||||
<div >
|
||||
<%# issue_count = project.issues.count %>
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class ChanegDescriptionTypeInSoftapplicaitons < ActiveRecord::Migration
|
||||
def change
|
||||
change_column :softapplications, :description, :text
|
||||
end
|
||||
end
|
|
@ -0,0 +1,26 @@
|
|||
class Legacy
|
||||
def self.clear_period
|
||||
begin
|
||||
count = 0
|
||||
puts '---------------------'
|
||||
|
||||
Course.transaction do
|
||||
Course.all.each do |course|
|
||||
if course.class_period =~ /^\D*$/
|
||||
count += 1
|
||||
puts "[#{course.id}]: #{course.name}"
|
||||
puts "period #{course.class_period} ===> 0"
|
||||
puts '---------------------'
|
||||
course.class_period = '0'
|
||||
course.save
|
||||
end
|
||||
end # each end
|
||||
end # transaction end
|
||||
|
||||
puts "clean period count: #{count}"
|
||||
rescue Exception => ex
|
||||
puts "*** transaction abored!"
|
||||
puts "*** errors: #{ex.message}"
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,8 @@
|
|||
desc "migrate old data."
|
||||
|
||||
namespace :legacy do
|
||||
desc "migrate Course class period data"
|
||||
task :clear_period => :environment do
|
||||
Legacy.clear_period
|
||||
end
|
||||
end
|
|
@ -1,10 +1,75 @@
|
|||
/*
|
||||
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
(function(){function c(b){var c=this instanceof CKEDITOR.ui.dialog.checkbox;b.hasAttribute(this.id)&&(b=b.getAttribute(this.id),c?this.setValue(e[this.id]["true"]==b.toLowerCase()):this.setValue(b))}function d(b){var c=""===this.getValue(),a=this instanceof CKEDITOR.ui.dialog.checkbox,d=this.getValue();c?b.removeAttribute(this.att||this.id):a?b.setAttribute(this.id,e[this.id][d]):b.setAttribute(this.att||this.id,d)}var e={scrolling:{"true":"yes","false":"no"},frameborder:{"true":"1","false":"0"}};
|
||||
CKEDITOR.dialog.add("iframe",function(b){var f=b.lang.iframe,a=b.lang.common,e=b.plugins.dialogadvtab;return{title:f.title,minWidth:350,minHeight:260,onShow:function(){this.fakeImage=this.iframeNode=null;var a=this.getSelectedElement();a&&(a.data("cke-real-element-type")&&"iframe"==a.data("cke-real-element-type"))&&(this.fakeImage=a,this.iframeNode=a=b.restoreRealElement(a),this.setupContent(a))},onOk:function(){var a;a=this.fakeImage?this.iframeNode:new CKEDITOR.dom.element("iframe");var c={},d=
|
||||
{};this.commitContent(a,c,d);a=b.createFakeElement(a,"cke_iframe","iframe",!0);a.setAttributes(d);a.setStyles(c);this.fakeImage?(a.replace(this.fakeImage),b.getSelection().selectElement(a)):b.insertElement(a)},contents:[{id:"info",label:a.generalTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{id:"src",type:"text",label:a.url,required:!0,validate:CKEDITOR.dialog.validate.notEmpty(f.noUrl),setup:c,commit:d}]},{type:"hbox",children:[{id:"width",type:"text",requiredContent:"iframe[width]",
|
||||
style:"width:100%",labelLayout:"vertical",label:a.width,validate:CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1",a.width)),setup:c,commit:d},{id:"height",type:"text",requiredContent:"iframe[height]",style:"width:100%",labelLayout:"vertical",label:a.height,validate:CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1",a.height)),setup:c,commit:d},{id:"align",type:"select",requiredContent:"iframe[align]","default":"",items:[[a.notSet,""],[a.alignLeft,"left"],[a.alignRight,
|
||||
"right"],[a.alignTop,"top"],[a.alignMiddle,"middle"],[a.alignBottom,"bottom"]],style:"width:100%",labelLayout:"vertical",label:a.align,setup:function(a,b){c.apply(this,arguments);if(b){var d=b.getAttribute("align");this.setValue(d&&d.toLowerCase()||"")}},commit:function(a,b,c){d.apply(this,arguments);this.getValue()&&(c.align=this.getValue())}}]},{type:"hbox",widths:["50%","50%"],children:[{id:"scrolling",type:"checkbox",requiredContent:"iframe[scrolling]",label:f.scrolling,setup:c,commit:d},{id:"frameborder",
|
||||
type:"checkbox",requiredContent:"iframe[frameborder]",label:f.border,setup:c,commit:d}]},{type:"hbox",widths:["50%","50%"],children:[{id:"name",type:"text",requiredContent:"iframe[name]",label:a.name,setup:c,commit:d},{id:"title",type:"text",requiredContent:"iframe[title]",label:a.advisoryTitle,setup:c,commit:d}]},{id:"longdesc",type:"text",requiredContent:"iframe[longdesc]",label:a.longDescr,setup:c,commit:d}]},e&&e.createAdvancedTab(b,{id:1,classes:1,styles:1},"iframe")]}})})();
|
||||
*/
|
||||
(function () {
|
||||
function c(b) {
|
||||
var c = this instanceof CKEDITOR.ui.dialog.checkbox;
|
||||
b.hasAttribute(this.id) && (b = b.getAttribute(this.id), c ? this.setValue(e[this.id]["true"] == b.toLowerCase()) : this.setValue(b))
|
||||
}
|
||||
|
||||
function d(b) {
|
||||
var c = "" === this.getValue(), a = this instanceof CKEDITOR.ui.dialog.checkbox, d = this.getValue();
|
||||
c ? b.removeAttribute(this.att || this.id) : a ? b.setAttribute(this.id, e[this.id][d]) : b.setAttribute(this.att || this.id, d)
|
||||
}
|
||||
|
||||
var e = {scrolling: {"true": "yes", "false": "no"}, frameborder: {"true": "1", "false": "0"}};
|
||||
CKEDITOR.dialog.add("iframe", function (b) {
|
||||
var f = b.lang.iframe, a = b.lang.common, e = b.plugins.dialogadvtab;
|
||||
return{title: f.title, minWidth: 350, minHeight: 260, onShow: function () {
|
||||
this.fakeImage = this.iframeNode = null;
|
||||
var a = this.getSelectedElement();
|
||||
a && (a.data("cke-real-element-type") && "iframe" == a.data("cke-real-element-type")) && (this.fakeImage = a, this.iframeNode = a = b.restoreRealElement(a), this.setupContent(a))
|
||||
}, onOk: function () {
|
||||
var a;
|
||||
a = this.fakeImage ? this.iframeNode : new CKEDITOR.dom.element("iframe");
|
||||
var c = {}, d =
|
||||
{};
|
||||
this.commitContent(a, c, d);
|
||||
a = b.createFakeElement(a, "cke_iframe", "iframe", !0);
|
||||
a.setAttributes(d);
|
||||
a.setStyles(c);
|
||||
this.fakeImage ? (a.replace(this.fakeImage), b.getSelection().selectElement(a)) : b.insertElement(a)
|
||||
}, contents: [
|
||||
{id: "info", label: a.generalTab, accessKey: "I", elements: [
|
||||
{type: "vbox", padding: 0, children: [
|
||||
{id: "src", type: "text", label: a.url, required: !0, validate: CKEDITOR.dialog.validate.notEmpty(f.noUrl), setup: c, commit: d}
|
||||
]},
|
||||
{type: "hbox", children: [
|
||||
{id: "width", type: "text", requiredContent: "iframe[width]",
|
||||
style: "width:100%", labelLayout: "vertical", label: a.width, validate: CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1", a.width)), setup: c, commit: d},
|
||||
{id: "height", type: "text", requiredContent: "iframe[height]", style: "width:100%", labelLayout: "vertical", label: a.height, validate: CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1", a.height)), setup: c, commit: d},
|
||||
{id: "align", type: "select", requiredContent: "iframe[align]", "default": "", items: [
|
||||
[a.notSet, ""],
|
||||
[a.alignLeft, "left"],
|
||||
[a.alignRight,
|
||||
"right"],
|
||||
[a.alignTop, "top"],
|
||||
[a.alignMiddle, "middle"],
|
||||
[a.alignBottom, "bottom"]
|
||||
], style: "width:100%", labelLayout: "vertical", label: a.align, setup: function (a, b) {
|
||||
c.apply(this, arguments);
|
||||
if (b) {
|
||||
var d = b.getAttribute("align");
|
||||
this.setValue(d && d.toLowerCase() || "")
|
||||
}
|
||||
}, commit: function (a, b, c) {
|
||||
d.apply(this, arguments);
|
||||
this.getValue() && (c.align = this.getValue())
|
||||
}}
|
||||
]},
|
||||
{type: "hbox", widths: ["50%", "50%"], children: [
|
||||
{id: "scrolling", type: "checkbox", requiredContent: "iframe[scrolling]", label: f.scrolling, setup: c, commit: d},
|
||||
{id: "frameborder",
|
||||
type: "checkbox", requiredContent: "iframe[frameborder]", label: f.border, setup: c, commit: d}
|
||||
]},
|
||||
{type: "hbox", widths: ["50%", "50%"], children: [
|
||||
{id: "name", type: "text", requiredContent: "iframe[name]", label: a.name, setup: c, commit: d},
|
||||
{id: "title", type: "text", requiredContent: "iframe[title]", label: a.advisoryTitle, setup: c, commit: d}
|
||||
]},
|
||||
{id: "longdesc", type: "text", requiredContent: "iframe[longdesc]", label: a.longDescr, setup: c, commit: d}
|
||||
]},
|
||||
e && e.createAdvancedTab(b, {id: 1, classes: 1, styles: 1}, "iframe")
|
||||
]}
|
||||
})
|
||||
})();
|
|
@ -1,37 +1,492 @@
|
|||
/*
|
||||
Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
|
||||
For licensing, see LICENSE.md or http://ckeditor.com/license
|
||||
*/
|
||||
CKEDITOR.dialog.add("link",function(n){var p,q;function r(a){return a.replace(/'/g,"\\$&")}function t(a){var g,c=p,d,e;g=[q,"("];for(var b=0;b<c.length;b++)d=c[b].toLowerCase(),e=a[d],0<b&&g.push(","),g.push("'",e?r(encodeURIComponent(a[d])):"","'");g.push(")");return g.join("")}function u(a){for(var g,c=a.length,d=[],e=0;e<c;e++)g=a.charCodeAt(e),d.push(g);return"String.fromCharCode("+d.join(",")+")"}function v(a){return(a=a.getAttribute("class"))?a.replace(/\s*(?:cke_anchor_empty|cke_anchor)(?:\s*$)?/g,
|
||||
""):""}var w=CKEDITOR.plugins.link,s=function(){var a=this.getDialog(),g=a.getContentElement("target","popupFeatures"),a=a.getContentElement("target","linkTargetName"),c=this.getValue();if(g&&a)switch(g=g.getElement(),g.hide(),a.setValue(""),c){case "frame":a.setLabel(n.lang.link.targetFrameName);a.getElement().show();break;case "popup":g.show();a.setLabel(n.lang.link.targetPopupName);a.getElement().show();break;default:a.setValue(c),a.getElement().hide()}},x=/^javascript:/,y=/^mailto:([^?]+)(?:\?(.+))?$/,
|
||||
z=/subject=([^;?:@&=$,\/]*)/,A=/body=([^;?:@&=$,\/]*)/,B=/^#(.*)$/,C=/^((?:http|https|ftp|news):\/\/)?(.*)$/,D=/^(_(?:self|top|parent|blank))$/,E=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,F=/^javascript:([^(]+)\(([^)]+)\)$/,G=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,H=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,I=function(a,g){var c=g&&(g.data("cke-saved-href")||g.getAttribute("href"))||"",d,e,b=
|
||||
{};c.match(x)&&("encode"==o?c=c.replace(E,function(a,c,b){return"mailto:"+String.fromCharCode.apply(String,c.split(","))+(b&&b.replace(/\\'/g,"'"))}):o&&c.replace(F,function(a,c,d){if(c==q){b.type="email";for(var a=b.email={},c=/(^')|('$)/g,d=d.match(/[^,\s]+/g),e=d.length,g,f,h=0;h<e;h++)g=decodeURIComponent,f=d[h].replace(c,"").replace(/\\'/g,"'"),f=g(f),g=p[h].toLowerCase(),a[g]=f;a.address=[a.name,a.domain].join("@")}}));if(!b.type)if(d=c.match(B))b.type="anchor",b.anchor={},b.anchor.name=b.anchor.id=
|
||||
d[1];else if(d=c.match(y)){e=c.match(z);c=c.match(A);b.type="email";var f=b.email={};f.address=d[1];e&&(f.subject=decodeURIComponent(e[1]));c&&(f.body=decodeURIComponent(c[1]))}else c&&(e=c.match(C))?(b.type="url",b.url={},b.url.protocol=e[1],b.url.url=e[2]):b.type="url";if(g){d=g.getAttribute("target");b.target={};b.adv={};if(d)d.match(D)?b.target.type=b.target.name=d:(b.target.type="frame",b.target.name=d);else if(d=(d=g.data("cke-pa-onclick")||g.getAttribute("onclick"))&&d.match(G)){b.target.type=
|
||||
"popup";for(b.target.name=d[1];c=H.exec(d[2]);)("yes"==c[2]||"1"==c[2])&&!(c[1]in{height:1,width:1,top:1,left:1})?b.target[c[1]]=!0:isFinite(c[2])&&(b.target[c[1]]=c[2])}d=function(a,c){var d=g.getAttribute(c);null!==d&&(b.adv[a]=d||"")};d("advId","id");d("advLangDir","dir");d("advAccessKey","accessKey");b.adv.advName=g.data("cke-saved-name")||g.getAttribute("name")||"";d("advLangCode","lang");d("advTabIndex","tabindex");d("advTitle","title");d("advContentType","type");CKEDITOR.plugins.link.synAnchorSelector?
|
||||
b.adv.advCSSClasses=v(g):d("advCSSClasses","class");d("advCharset","charset");d("advStyles","style");d("advRel","rel")}d=b.anchors=[];var h;if(CKEDITOR.plugins.link.emptyAnchorFix){f=a.document.getElementsByTag("a");c=0;for(e=f.count();c<e;c++)if(h=f.getItem(c),h.data("cke-saved-name")||h.hasAttribute("name"))d.push({name:h.data("cke-saved-name")||h.getAttribute("name"),id:h.getAttribute("id")})}else{f=new CKEDITOR.dom.nodeList(a.document.$.anchors);c=0;for(e=f.count();c<e;c++)h=f.getItem(c),d[c]=
|
||||
{name:h.getAttribute("name"),id:h.getAttribute("id")}}if(CKEDITOR.plugins.link.fakeAnchor){f=a.document.getElementsByTag("img");c=0;for(e=f.count();c<e;c++)(h=CKEDITOR.plugins.link.tryRestoreFakeAnchor(a,f.getItem(c)))&&d.push({name:h.getAttribute("name"),id:h.getAttribute("id")})}this._.selectedElement=g;return b},j=function(a){a.target&&this.setValue(a.target[this.id]||"")},k=function(a){a.adv&&this.setValue(a.adv[this.id]||"")},l=function(a){a.target||(a.target={});a.target[this.id]=this.getValue()||
|
||||
""},m=function(a){a.adv||(a.adv={});a.adv[this.id]=this.getValue()||""},o=n.config.emailProtection||"";o&&"encode"!=o&&(q=p=void 0,o.replace(/^([^(]+)\(([^)]+)\)$/,function(a,b,c){q=b;p=[];c.replace(/[^,\s]+/g,function(a){p.push(a)})}));var i=n.lang.common,b=n.lang.link;return{title:b.title,minWidth:350,minHeight:230,contents:[{id:"info",label:b.info,title:b.info,elements:[{id:"linkType",type:"select",label:b.type,"default":"url",items:[[b.toUrl,"url"],[b.toAnchor,"anchor"],[b.toEmail,"email"]],onChange:function(){var a=
|
||||
this.getDialog(),b=["urlOptions","anchorOptions","emailOptions"],c=this.getValue(),d=a.definition.getContents("upload"),d=d&&d.hidden;if(c=="url"){n.config.linkShowTargetTab&&a.showPage("target");d||a.showPage("upload")}else{a.hidePage("target");d||a.hidePage("upload")}for(d=0;d<b.length;d++){var e=a.getContentElement("info",b[d]);if(e){e=e.getElement().getParent().getParent();b[d]==c+"Options"?e.show():e.hide()}}a.layout()},setup:function(a){a.type&&this.setValue(a.type)},commit:function(a){a.type=
|
||||
this.getValue()}},{type:"vbox",id:"urlOptions",children:[{type:"hbox",widths:["25%","75%"],children:[{id:"protocol",type:"select",label:i.protocol,"default":"http://",items:[["http://","http://"],["https://","https://"],["ftp://","ftp://"],["news://","news://"],[b.other,""]],setup:function(a){a.url&&this.setValue(a.url.protocol||"")},commit:function(a){if(!a.url)a.url={};a.url.protocol=this.getValue()}},{type:"text",id:"url",label:i.url,required:!0,onLoad:function(){this.allowOnChange=true},onKeyUp:function(){this.allowOnChange=
|
||||
false;var a=this.getDialog().getContentElement("info","protocol"),b=this.getValue(),c=/^((javascript:)|[#\/\.\?])/i,d=/^(http|https|ftp|news):\/\/(?=.)/i.exec(b);if(d){this.setValue(b.substr(d[0].length));a.setValue(d[0].toLowerCase())}else c.test(b)&&a.setValue("");this.allowOnChange=true},onChange:function(){if(this.allowOnChange)this.onKeyUp()},validate:function(){var a=this.getDialog();if(a.getContentElement("info","linkType")&&a.getValueOf("info","linkType")!="url")return true;if(/javascript\:/.test(this.getValue())){alert(i.invalidValue);
|
||||
return false}return this.getDialog().fakeObj?true:CKEDITOR.dialog.validate.notEmpty(b.noUrl).apply(this)},setup:function(a){this.allowOnChange=false;a.url&&this.setValue(a.url.url);this.allowOnChange=true},commit:function(a){this.onChange();if(!a.url)a.url={};a.url.url=this.getValue();this.allowOnChange=false}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().show()}},{type:"button",id:"browse",hidden:"true",filebrowser:"info:url",label:i.browseServer}]},
|
||||
{type:"vbox",id:"anchorOptions",width:260,align:"center",padding:0,children:[{type:"fieldset",id:"selectAnchorText",label:b.selectAnchor,setup:function(a){a.anchors.length>0?this.getElement().show():this.getElement().hide()},children:[{type:"hbox",id:"selectAnchor",children:[{type:"select",id:"anchorName","default":"",label:b.anchorName,style:"width: 100%;",items:[[""]],setup:function(a){this.clear();this.add("");for(var b=0;b<a.anchors.length;b++)a.anchors[b].name&&this.add(a.anchors[b].name);a.anchor&&
|
||||
this.setValue(a.anchor.name);(a=this.getDialog().getContentElement("info","linkType"))&&a.getValue()=="email"&&this.focus()},commit:function(a){if(!a.anchor)a.anchor={};a.anchor.name=this.getValue()}},{type:"select",id:"anchorId","default":"",label:b.anchorId,style:"width: 100%;",items:[[""]],setup:function(a){this.clear();this.add("");for(var b=0;b<a.anchors.length;b++)a.anchors[b].id&&this.add(a.anchors[b].id);a.anchor&&this.setValue(a.anchor.id)},commit:function(a){if(!a.anchor)a.anchor={};a.anchor.id=
|
||||
this.getValue()}}],setup:function(a){a.anchors.length>0?this.getElement().show():this.getElement().hide()}}]},{type:"html",id:"noAnchors",style:"text-align: center;",html:'<div role="note" tabIndex="-1">'+CKEDITOR.tools.htmlEncode(b.noAnchors)+"</div>",focus:!0,setup:function(a){a.anchors.length<1?this.getElement().show():this.getElement().hide()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}},{type:"vbox",id:"emailOptions",padding:1,children:[{type:"text",
|
||||
id:"emailAddress",label:b.emailAddress,required:!0,validate:function(){var a=this.getDialog();return!a.getContentElement("info","linkType")||a.getValueOf("info","linkType")!="email"?true:CKEDITOR.dialog.validate.notEmpty(b.noEmail).apply(this)},setup:function(a){a.email&&this.setValue(a.email.address);(a=this.getDialog().getContentElement("info","linkType"))&&a.getValue()=="email"&&this.select()},commit:function(a){if(!a.email)a.email={};a.email.address=this.getValue()}},{type:"text",id:"emailSubject",
|
||||
label:b.emailSubject,setup:function(a){a.email&&this.setValue(a.email.subject)},commit:function(a){if(!a.email)a.email={};a.email.subject=this.getValue()}},{type:"textarea",id:"emailBody",label:b.emailBody,rows:3,"default":"",setup:function(a){a.email&&this.setValue(a.email.body)},commit:function(a){if(!a.email)a.email={};a.email.body=this.getValue()}}],setup:function(){this.getDialog().getContentElement("info","linkType")||this.getElement().hide()}}]},{id:"target",requiredContent:"a[target]",label:b.target,
|
||||
title:b.target,elements:[{type:"hbox",widths:["50%","50%"],children:[{type:"select",id:"linkTargetType",label:i.target,"default":"notSet",style:"width : 100%;",items:[[i.notSet,"notSet"],[b.targetFrame,"frame"],[b.targetPopup,"popup"],[i.targetNew,"_blank"],[i.targetTop,"_top"],[i.targetSelf,"_self"],[i.targetParent,"_parent"]],onChange:s,setup:function(a){a.target&&this.setValue(a.target.type||"notSet");s.call(this)},commit:function(a){if(!a.target)a.target={};a.target.type=this.getValue()}},{type:"text",
|
||||
id:"linkTargetName",label:b.targetFrameName,"default":"",setup:function(a){a.target&&this.setValue(a.target.name)},commit:function(a){if(!a.target)a.target={};a.target.name=this.getValue().replace(/\W/gi,"")}}]},{type:"vbox",width:"100%",align:"center",padding:2,id:"popupFeatures",children:[{type:"fieldset",label:b.popupFeatures,children:[{type:"hbox",children:[{type:"checkbox",id:"resizable",label:b.popupResizable,setup:j,commit:l},{type:"checkbox",id:"status",label:b.popupStatusBar,setup:j,commit:l}]},
|
||||
{type:"hbox",children:[{type:"checkbox",id:"location",label:b.popupLocationBar,setup:j,commit:l},{type:"checkbox",id:"toolbar",label:b.popupToolbar,setup:j,commit:l}]},{type:"hbox",children:[{type:"checkbox",id:"menubar",label:b.popupMenuBar,setup:j,commit:l},{type:"checkbox",id:"fullscreen",label:b.popupFullScreen,setup:j,commit:l}]},{type:"hbox",children:[{type:"checkbox",id:"scrollbars",label:b.popupScrollBars,setup:j,commit:l},{type:"checkbox",id:"dependent",label:b.popupDependent,setup:j,commit:l}]},
|
||||
{type:"hbox",children:[{type:"text",widths:["50%","50%"],labelLayout:"horizontal",label:i.width,id:"width",setup:j,commit:l},{type:"text",labelLayout:"horizontal",widths:["50%","50%"],label:b.popupLeft,id:"left",setup:j,commit:l}]},{type:"hbox",children:[{type:"text",labelLayout:"horizontal",widths:["50%","50%"],label:i.height,id:"height",setup:j,commit:l},{type:"text",labelLayout:"horizontal",label:b.popupTop,widths:["50%","50%"],id:"top",setup:j,commit:l}]}]}]}]},{id:"upload",label:b.upload,title:b.upload,
|
||||
hidden:!0,filebrowser:"uploadButton",elements:[{type:"file",id:"upload",label:i.upload,style:"height:40px",size:29},{type:"fileButton",id:"uploadButton",label:i.uploadSubmit,filebrowser:"info:url","for":["upload","upload"]}]},{id:"advanced",label:b.advanced,title:b.advanced,elements:[{type:"vbox",padding:1,children:[{type:"hbox",widths:["45%","35%","20%"],children:[{type:"text",id:"advId",requiredContent:"a[id]",label:b.id,setup:k,commit:m},{type:"select",id:"advLangDir",requiredContent:"a[dir]",
|
||||
label:b.langDir,"default":"",style:"width:110px",items:[[i.notSet,""],[b.langDirLTR,"ltr"],[b.langDirRTL,"rtl"]],setup:k,commit:m},{type:"text",id:"advAccessKey",requiredContent:"a[accesskey]",width:"80px",label:b.acccessKey,maxLength:1,setup:k,commit:m}]},{type:"hbox",widths:["45%","35%","20%"],children:[{type:"text",label:b.name,id:"advName",requiredContent:"a[name]",setup:k,commit:m},{type:"text",label:b.langCode,id:"advLangCode",requiredContent:"a[lang]",width:"110px","default":"",setup:k,commit:m},
|
||||
{type:"text",label:b.tabIndex,id:"advTabIndex",requiredContent:"a[tabindex]",width:"80px",maxLength:5,setup:k,commit:m}]}]},{type:"vbox",padding:1,children:[{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:b.advisoryTitle,requiredContent:"a[title]","default":"",id:"advTitle",setup:k,commit:m},{type:"text",label:b.advisoryContentType,requiredContent:"a[type]","default":"",id:"advContentType",setup:k,commit:m}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:b.cssClasses,
|
||||
requiredContent:"a(cke-xyz)","default":"",id:"advCSSClasses",setup:k,commit:m},{type:"text",label:b.charset,requiredContent:"a[charset]","default":"",id:"advCharset",setup:k,commit:m}]},{type:"hbox",widths:["45%","55%"],children:[{type:"text",label:b.rel,requiredContent:"a[rel]","default":"",id:"advRel",setup:k,commit:m},{type:"text",label:b.styles,requiredContent:"a{cke-xyz}","default":"",id:"advStyles",validate:CKEDITOR.dialog.validate.inlineStyle(n.lang.common.invalidInlineStyle),setup:k,commit:m}]}]}]}],
|
||||
onShow:function(){var a=this.getParentEditor(),b=a.getSelection(),c=null;(c=w.getSelectedLink(a))&&c.hasAttribute("href")?b.getSelectedElement()||b.selectElement(c):c=null;this.setupContent(I.apply(this,[a,c]))},onOk:function(){var a={},b=[],c={},d=this.getParentEditor();this.commitContent(c);switch(c.type||"url"){case "url":var e=c.url&&c.url.protocol!=void 0?c.url.protocol:"http://",i=c.url&&CKEDITOR.tools.trim(c.url.url)||"";a["data-cke-saved-href"]=i.indexOf("/")===0?i:e+i;break;case "anchor":e=
|
||||
c.anchor&&c.anchor.id;a["data-cke-saved-href"]="#"+(c.anchor&&c.anchor.name||e||"");break;case "email":var f=c.email,e=f.address;switch(o){case "":case "encode":var i=encodeURIComponent(f.subject||""),h=encodeURIComponent(f.body||""),f=[];i&&f.push("subject="+i);h&&f.push("body="+h);f=f.length?"?"+f.join("&"):"";if(o=="encode"){e=["javascript:void(location.href='mailto:'+",u(e)];f&&e.push("+'",r(f),"'");e.push(")")}else e=["mailto:",e,f];break;default:e=e.split("@",2);f.name=e[0];f.domain=e[1];e=
|
||||
["javascript:",t(f)]}a["data-cke-saved-href"]=e.join("")}if(c.target)if(c.target.type=="popup"){for(var e=["window.open(this.href, '",c.target.name||"","', '"],j=["resizable","status","location","toolbar","menubar","fullscreen","scrollbars","dependent"],i=j.length,f=function(a){c.target[a]&&j.push(a+"="+c.target[a])},h=0;h<i;h++)j[h]=j[h]+(c.target[j[h]]?"=yes":"=no");f("width");f("left");f("height");f("top");e.push(j.join(","),"'); return false;");a["data-cke-pa-onclick"]=e.join("");b.push("target")}else{c.target.type!=
|
||||
"notSet"&&c.target.name?a.target=c.target.name:b.push("target");b.push("data-cke-pa-onclick","onclick")}if(c.adv){e=function(d,e){var f=c.adv[d];f?a[e]=f:b.push(e)};e("advId","id");e("advLangDir","dir");e("advAccessKey","accessKey");c.adv.advName?a.name=a["data-cke-saved-name"]=c.adv.advName:b=b.concat(["data-cke-saved-name","name"]);e("advLangCode","lang");e("advTabIndex","tabindex");e("advTitle","title");e("advContentType","type");e("advCSSClasses","class");e("advCharset","charset");e("advStyles",
|
||||
"style");e("advRel","rel")}e=d.getSelection();a.href=a["data-cke-saved-href"];if(this._.selectedElement){d=this._.selectedElement;i=d.data("cke-saved-href");f=d.getHtml();d.setAttributes(a);d.removeAttributes(b);c.adv&&(c.adv.advName&&CKEDITOR.plugins.link.synAnchorSelector)&&d.addClass(d.getChildCount()?"cke_anchor":"cke_anchor_empty");if(i==f||c.type=="email"&&f.indexOf("@")!=-1){d.setHtml(c.type=="email"?c.email.address:a["data-cke-saved-href"]);e.selectElement(d)}delete this._.selectedElement}else{e=
|
||||
e.getRanges()[0];if(e.collapsed){d=new CKEDITOR.dom.text(c.type=="email"?c.email.address:a["data-cke-saved-href"],d.document);e.insertNode(d);e.selectNodeContents(d)}d=new CKEDITOR.style({element:"a",attributes:a});d.type=CKEDITOR.STYLE_INLINE;d.applyToRange(e);e.select()}},onLoad:function(){n.config.linkShowAdvancedTab||this.hidePage("advanced");n.config.linkShowTargetTab||this.hidePage("target")},onFocus:function(){var a=this.getContentElement("info","linkType");if(a&&a.getValue()=="url"){a=this.getContentElement("info",
|
||||
"url");a.select()}}}});
|
||||
*/
|
||||
CKEDITOR.dialog.add("link", function (n) {
|
||||
var p, q;
|
||||
|
||||
function r(a) {
|
||||
return a.replace(/'/g, "\\$&")
|
||||
}
|
||||
|
||||
function t(a) {
|
||||
var g, c = p, d, e;
|
||||
g = [q, "("];
|
||||
for (var b = 0; b < c.length; b++)d = c[b].toLowerCase(), e = a[d], 0 < b && g.push(","), g.push("'", e ? r(encodeURIComponent(a[d])) : "", "'");
|
||||
g.push(")");
|
||||
return g.join("")
|
||||
}
|
||||
|
||||
function u(a) {
|
||||
for (var g, c = a.length, d = [], e = 0; e < c; e++)g = a.charCodeAt(e), d.push(g);
|
||||
return"String.fromCharCode(" + d.join(",") + ")"
|
||||
}
|
||||
|
||||
function v(a) {
|
||||
return(a = a.getAttribute("class")) ? a.replace(/\s*(?:cke_anchor_empty|cke_anchor)(?:\s*$)?/g,
|
||||
"") : ""
|
||||
}
|
||||
|
||||
var w = CKEDITOR.plugins.link, s = function () {
|
||||
var a = this.getDialog(), g = a.getContentElement("target", "popupFeatures"), a = a.getContentElement("target", "linkTargetName"), c = this.getValue();
|
||||
if (g && a)switch (g = g.getElement(), g.hide(), a.setValue(""), c) {
|
||||
case "frame":
|
||||
a.setLabel(n.lang.link.targetFrameName);
|
||||
a.getElement().show();
|
||||
break;
|
||||
case "popup":
|
||||
g.show();
|
||||
a.setLabel(n.lang.link.targetPopupName);
|
||||
a.getElement().show();
|
||||
break;
|
||||
default:
|
||||
a.setValue(c), a.getElement().hide()
|
||||
}
|
||||
}, x = /^javascript:/, y = /^mailto:([^?]+)(?:\?(.+))?$/,
|
||||
z = /subject=([^;?:@&=$,\/]*)/, A = /body=([^;?:@&=$,\/]*)/, B = /^#(.*)$/, C = /^((?:http|https|ftp|news):\/\/)?(.*)$/, D = /^(_(?:self|top|parent|blank))$/, E = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/, F = /^javascript:([^(]+)\(([^)]+)\)$/, G = /\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/, H = /(?:^|,)([^=]+)=(\d+|yes|no)/gi, I = function (a, g) {
|
||||
var c = g && (g.data("cke-saved-href") || g.getAttribute("href")) || "", d, e, b =
|
||||
{};
|
||||
c.match(x) && ("encode" == o ? c = c.replace(E, function (a, c, b) {
|
||||
return"mailto:" + String.fromCharCode.apply(String, c.split(",")) + (b && b.replace(/\\'/g, "'"))
|
||||
}) : o && c.replace(F, function (a, c, d) {
|
||||
if (c == q) {
|
||||
b.type = "email";
|
||||
for (var a = b.email = {}, c = /(^')|('$)/g, d = d.match(/[^,\s]+/g), e = d.length, g, f, h = 0; h < e; h++)g = decodeURIComponent, f = d[h].replace(c, "").replace(/\\'/g, "'"), f = g(f), g = p[h].toLowerCase(), a[g] = f;
|
||||
a.address = [a.name, a.domain].join("@")
|
||||
}
|
||||
}));
|
||||
if (!b.type)if (d = c.match(B))b.type = "anchor", b.anchor = {}, b.anchor.name = b.anchor.id =
|
||||
d[1]; else if (d = c.match(y)) {
|
||||
e = c.match(z);
|
||||
c = c.match(A);
|
||||
b.type = "email";
|
||||
var f = b.email = {};
|
||||
f.address = d[1];
|
||||
e && (f.subject = decodeURIComponent(e[1]));
|
||||
c && (f.body = decodeURIComponent(c[1]))
|
||||
} else c && (e = c.match(C)) ? (b.type = "url", b.url = {}, b.url.protocol = e[1], b.url.url = e[2]) : b.type = "url";
|
||||
if (g) {
|
||||
d = g.getAttribute("target");
|
||||
b.target = {};
|
||||
b.adv = {};
|
||||
if (d)d.match(D) ? b.target.type = b.target.name = d : (b.target.type = "frame", b.target.name = d); else if (d = (d = g.data("cke-pa-onclick") || g.getAttribute("onclick")) && d.match(G)) {
|
||||
b.target.type =
|
||||
"popup";
|
||||
for (b.target.name = d[1]; c = H.exec(d[2]);)("yes" == c[2] || "1" == c[2]) && !(c[1]in{height: 1, width: 1, top: 1, left: 1}) ? b.target[c[1]] = !0 : isFinite(c[2]) && (b.target[c[1]] = c[2])
|
||||
}
|
||||
d = function (a, c) {
|
||||
var d = g.getAttribute(c);
|
||||
null !== d && (b.adv[a] = d || "")
|
||||
};
|
||||
d("advId", "id");
|
||||
d("advLangDir", "dir");
|
||||
d("advAccessKey", "accessKey");
|
||||
b.adv.advName = g.data("cke-saved-name") || g.getAttribute("name") || "";
|
||||
d("advLangCode", "lang");
|
||||
d("advTabIndex", "tabindex");
|
||||
d("advTitle", "title");
|
||||
d("advContentType", "type");
|
||||
CKEDITOR.plugins.link.synAnchorSelector ?
|
||||
b.adv.advCSSClasses = v(g) : d("advCSSClasses", "class");
|
||||
d("advCharset", "charset");
|
||||
d("advStyles", "style");
|
||||
d("advRel", "rel")
|
||||
}
|
||||
d = b.anchors = [];
|
||||
var h;
|
||||
if (CKEDITOR.plugins.link.emptyAnchorFix) {
|
||||
f = a.document.getElementsByTag("a");
|
||||
c = 0;
|
||||
for (e = f.count(); c < e; c++)if (h = f.getItem(c), h.data("cke-saved-name") || h.hasAttribute("name"))d.push({name: h.data("cke-saved-name") || h.getAttribute("name"), id: h.getAttribute("id")})
|
||||
} else {
|
||||
f = new CKEDITOR.dom.nodeList(a.document.$.anchors);
|
||||
c = 0;
|
||||
for (e = f.count(); c < e; c++)h = f.getItem(c), d[c] =
|
||||
{name: h.getAttribute("name"), id: h.getAttribute("id")}
|
||||
}
|
||||
if (CKEDITOR.plugins.link.fakeAnchor) {
|
||||
f = a.document.getElementsByTag("img");
|
||||
c = 0;
|
||||
for (e = f.count(); c < e; c++)(h = CKEDITOR.plugins.link.tryRestoreFakeAnchor(a, f.getItem(c))) && d.push({name: h.getAttribute("name"), id: h.getAttribute("id")})
|
||||
}
|
||||
this._.selectedElement = g;
|
||||
return b
|
||||
}, j = function (a) {
|
||||
a.target && this.setValue(a.target[this.id] || "")
|
||||
}, k = function (a) {
|
||||
a.adv && this.setValue(a.adv[this.id] || "")
|
||||
}, l = function (a) {
|
||||
a.target || (a.target = {});
|
||||
a.target[this.id] = this.getValue() ||
|
||||
""
|
||||
}, m = function (a) {
|
||||
a.adv || (a.adv = {});
|
||||
a.adv[this.id] = this.getValue() || ""
|
||||
}, o = n.config.emailProtection || "";
|
||||
o && "encode" != o && (q = p = void 0, o.replace(/^([^(]+)\(([^)]+)\)$/, function (a, b, c) {
|
||||
q = b;
|
||||
p = [];
|
||||
c.replace(/[^,\s]+/g, function (a) {
|
||||
p.push(a)
|
||||
})
|
||||
}));
|
||||
var i = n.lang.common, b = n.lang.link;
|
||||
return{title: b.title, minWidth: 350, minHeight: 230, contents: [
|
||||
{id: "info", label: b.info, title: b.info, elements: [
|
||||
{id: "linkType", type: "select", label: b.type, "default": "url", items: [
|
||||
[b.toUrl, "url"],
|
||||
[b.toAnchor, "anchor"],
|
||||
[b.toEmail, "email"]
|
||||
], onChange: function () {
|
||||
var a =
|
||||
this.getDialog(), b = ["urlOptions", "anchorOptions", "emailOptions"], c = this.getValue(), d = a.definition.getContents("upload"), d = d && d.hidden;
|
||||
if (c == "url") {
|
||||
n.config.linkShowTargetTab && a.showPage("target");
|
||||
d || a.showPage("upload")
|
||||
} else {
|
||||
a.hidePage("target");
|
||||
d || a.hidePage("upload")
|
||||
}
|
||||
for (d = 0; d < b.length; d++) {
|
||||
var e = a.getContentElement("info", b[d]);
|
||||
if (e) {
|
||||
e = e.getElement().getParent().getParent();
|
||||
b[d] == c + "Options" ? e.show() : e.hide()
|
||||
}
|
||||
}
|
||||
a.layout()
|
||||
}, setup: function (a) {
|
||||
a.type && this.setValue(a.type)
|
||||
}, commit: function (a) {
|
||||
a.type =
|
||||
this.getValue()
|
||||
}},
|
||||
{type: "vbox", id: "urlOptions", children: [
|
||||
{type: "hbox", widths: ["25%", "75%"], children: [
|
||||
{id: "protocol", type: "select", label: i.protocol, "default": "http://", items: [
|
||||
["http://", "http://"],
|
||||
["https://", "https://"],
|
||||
["ftp://", "ftp://"],
|
||||
["news://", "news://"],
|
||||
[b.other, ""]
|
||||
], setup: function (a) {
|
||||
a.url && this.setValue(a.url.protocol || "")
|
||||
}, commit: function (a) {
|
||||
if (!a.url)a.url = {};
|
||||
a.url.protocol = this.getValue()
|
||||
}},
|
||||
{type: "text", id: "url", label: i.url, required: !0, onLoad: function () {
|
||||
this.allowOnChange = true
|
||||
}, onKeyUp: function () {
|
||||
this.allowOnChange =
|
||||
false;
|
||||
var a = this.getDialog().getContentElement("info", "protocol"), b = this.getValue(), c = /^((javascript:)|[#\/\.\?])/i, d = /^(http|https|ftp|news):\/\/(?=.)/i.exec(b);
|
||||
if (d) {
|
||||
this.setValue(b.substr(d[0].length));
|
||||
a.setValue(d[0].toLowerCase())
|
||||
} else c.test(b) && a.setValue("");
|
||||
this.allowOnChange = true
|
||||
}, onChange: function () {
|
||||
if (this.allowOnChange)this.onKeyUp()
|
||||
}, validate: function () {
|
||||
var a = this.getDialog();
|
||||
if (a.getContentElement("info", "linkType") && a.getValueOf("info", "linkType") != "url")return true;
|
||||
if (/javascript\:/.test(this.getValue())) {
|
||||
alert(i.invalidValue);
|
||||
return false
|
||||
}
|
||||
return this.getDialog().fakeObj ? true : CKEDITOR.dialog.validate.notEmpty(b.noUrl).apply(this)
|
||||
}, setup: function (a) {
|
||||
this.allowOnChange = false;
|
||||
a.url && this.setValue(a.url.url);
|
||||
this.allowOnChange = true
|
||||
}, commit: function (a) {
|
||||
this.onChange();
|
||||
if (!a.url)a.url = {};
|
||||
a.url.url = this.getValue();
|
||||
this.allowOnChange = false
|
||||
}}
|
||||
], setup: function () {
|
||||
this.getDialog().getContentElement("info", "linkType") || this.getElement().show()
|
||||
}},
|
||||
{type: "button", id: "browse", hidden: "true", filebrowser: "info:url", label: i.browseServer}
|
||||
]},
|
||||
{type: "vbox", id: "anchorOptions", width: 260, align: "center", padding: 0, children: [
|
||||
{type: "fieldset", id: "selectAnchorText", label: b.selectAnchor, setup: function (a) {
|
||||
a.anchors.length > 0 ? this.getElement().show() : this.getElement().hide()
|
||||
}, children: [
|
||||
{type: "hbox", id: "selectAnchor", children: [
|
||||
{type: "select", id: "anchorName", "default": "", label: b.anchorName, style: "width: 100%;", items: [
|
||||
[""]
|
||||
], setup: function (a) {
|
||||
this.clear();
|
||||
this.add("");
|
||||
for (var b = 0; b < a.anchors.length; b++)a.anchors[b].name && this.add(a.anchors[b].name);
|
||||
a.anchor &&
|
||||
this.setValue(a.anchor.name);
|
||||
(a = this.getDialog().getContentElement("info", "linkType")) && a.getValue() == "email" && this.focus()
|
||||
}, commit: function (a) {
|
||||
if (!a.anchor)a.anchor = {};
|
||||
a.anchor.name = this.getValue()
|
||||
}},
|
||||
{type: "select", id: "anchorId", "default": "", label: b.anchorId, style: "width: 100%;", items: [
|
||||
[""]
|
||||
], setup: function (a) {
|
||||
this.clear();
|
||||
this.add("");
|
||||
for (var b = 0; b < a.anchors.length; b++)a.anchors[b].id && this.add(a.anchors[b].id);
|
||||
a.anchor && this.setValue(a.anchor.id)
|
||||
}, commit: function (a) {
|
||||
if (!a.anchor)a.anchor = {};
|
||||
a.anchor.id =
|
||||
this.getValue()
|
||||
}}
|
||||
], setup: function (a) {
|
||||
a.anchors.length > 0 ? this.getElement().show() : this.getElement().hide()
|
||||
}}
|
||||
]},
|
||||
{type: "html", id: "noAnchors", style: "text-align: center;", html: '<div role="note" tabIndex="-1">' + CKEDITOR.tools.htmlEncode(b.noAnchors) + "</div>", focus: !0, setup: function (a) {
|
||||
a.anchors.length < 1 ? this.getElement().show() : this.getElement().hide()
|
||||
}}
|
||||
], setup: function () {
|
||||
this.getDialog().getContentElement("info", "linkType") || this.getElement().hide()
|
||||
}},
|
||||
{type: "vbox", id: "emailOptions", padding: 1, children: [
|
||||
{type: "text",
|
||||
id: "emailAddress", label: b.emailAddress, required: !0, validate: function () {
|
||||
var a = this.getDialog();
|
||||
return!a.getContentElement("info", "linkType") || a.getValueOf("info", "linkType") != "email" ? true : CKEDITOR.dialog.validate.notEmpty(b.noEmail).apply(this)
|
||||
}, setup: function (a) {
|
||||
a.email && this.setValue(a.email.address);
|
||||
(a = this.getDialog().getContentElement("info", "linkType")) && a.getValue() == "email" && this.select()
|
||||
}, commit: function (a) {
|
||||
if (!a.email)a.email = {};
|
||||
a.email.address = this.getValue()
|
||||
}},
|
||||
{type: "text", id: "emailSubject",
|
||||
label: b.emailSubject, setup: function (a) {
|
||||
a.email && this.setValue(a.email.subject)
|
||||
}, commit: function (a) {
|
||||
if (!a.email)a.email = {};
|
||||
a.email.subject = this.getValue()
|
||||
}},
|
||||
{type: "textarea", id: "emailBody", label: b.emailBody, rows: 3, "default": "", setup: function (a) {
|
||||
a.email && this.setValue(a.email.body)
|
||||
}, commit: function (a) {
|
||||
if (!a.email)a.email = {};
|
||||
a.email.body = this.getValue()
|
||||
}}
|
||||
], setup: function () {
|
||||
this.getDialog().getContentElement("info", "linkType") || this.getElement().hide()
|
||||
}}
|
||||
]},
|
||||
{id: "target", requiredContent: "a[target]", label: b.target,
|
||||
title: b.target, elements: [
|
||||
{type: "hbox", widths: ["50%", "50%"], children: [
|
||||
{type: "select", id: "linkTargetType", label: i.target, "default": "notSet", style: "width : 100%;", items: [
|
||||
[i.notSet, "notSet"],
|
||||
[b.targetFrame, "frame"],
|
||||
[b.targetPopup, "popup"],
|
||||
[i.targetNew, "_blank"],
|
||||
[i.targetTop, "_top"],
|
||||
[i.targetSelf, "_self"],
|
||||
[i.targetParent, "_parent"]
|
||||
], onChange: s, setup: function (a) {
|
||||
a.target && this.setValue(a.target.type || "notSet");
|
||||
s.call(this)
|
||||
}, commit: function (a) {
|
||||
if (!a.target)a.target = {};
|
||||
a.target.type = this.getValue()
|
||||
}},
|
||||
{type: "text",
|
||||
id: "linkTargetName", label: b.targetFrameName, "default": "", setup: function (a) {
|
||||
a.target && this.setValue(a.target.name)
|
||||
}, commit: function (a) {
|
||||
if (!a.target)a.target = {};
|
||||
a.target.name = this.getValue().replace(/\W/gi, "")
|
||||
}}
|
||||
]},
|
||||
{type: "vbox", width: "100%", align: "center", padding: 2, id: "popupFeatures", children: [
|
||||
{type: "fieldset", label: b.popupFeatures, children: [
|
||||
{type: "hbox", children: [
|
||||
{type: "checkbox", id: "resizable", label: b.popupResizable, setup: j, commit: l},
|
||||
{type: "checkbox", id: "status", label: b.popupStatusBar, setup: j, commit: l}
|
||||
]},
|
||||
{type: "hbox", children: [
|
||||
{type: "checkbox", id: "location", label: b.popupLocationBar, setup: j, commit: l},
|
||||
{type: "checkbox", id: "toolbar", label: b.popupToolbar, setup: j, commit: l}
|
||||
]},
|
||||
{type: "hbox", children: [
|
||||
{type: "checkbox", id: "menubar", label: b.popupMenuBar, setup: j, commit: l},
|
||||
{type: "checkbox", id: "fullscreen", label: b.popupFullScreen, setup: j, commit: l}
|
||||
]},
|
||||
{type: "hbox", children: [
|
||||
{type: "checkbox", id: "scrollbars", label: b.popupScrollBars, setup: j, commit: l},
|
||||
{type: "checkbox", id: "dependent", label: b.popupDependent, setup: j, commit: l}
|
||||
]},
|
||||
{type: "hbox", children: [
|
||||
{type: "text", widths: ["50%", "50%"], labelLayout: "horizontal", label: i.width, id: "width", setup: j, commit: l},
|
||||
{type: "text", labelLayout: "horizontal", widths: ["50%", "50%"], label: b.popupLeft, id: "left", setup: j, commit: l}
|
||||
]},
|
||||
{type: "hbox", children: [
|
||||
{type: "text", labelLayout: "horizontal", widths: ["50%", "50%"], label: i.height, id: "height", setup: j, commit: l},
|
||||
{type: "text", labelLayout: "horizontal", label: b.popupTop, widths: ["50%", "50%"], id: "top", setup: j, commit: l}
|
||||
]}
|
||||
]}
|
||||
]}
|
||||
]},
|
||||
{id: "upload", label: b.upload, title: b.upload,
|
||||
hidden: !0, filebrowser: "uploadButton", elements: [
|
||||
{type: "file", id: "upload", label: i.upload, style: "height:40px", size: 29},
|
||||
{type: "fileButton", id: "uploadButton", label: i.uploadSubmit, filebrowser: "info:url", "for": ["upload", "upload"]}
|
||||
]},
|
||||
{id: "advanced", label: b.advanced, title: b.advanced, elements: [
|
||||
{type: "vbox", padding: 1, children: [
|
||||
{type: "hbox", widths: ["45%", "35%", "20%"], children: [
|
||||
{type: "text", id: "advId", requiredContent: "a[id]", label: b.id, setup: k, commit: m},
|
||||
{type: "select", id: "advLangDir", requiredContent: "a[dir]",
|
||||
label: b.langDir, "default": "", style: "width:110px", items: [
|
||||
[i.notSet, ""],
|
||||
[b.langDirLTR, "ltr"],
|
||||
[b.langDirRTL, "rtl"]
|
||||
], setup: k, commit: m},
|
||||
{type: "text", id: "advAccessKey", requiredContent: "a[accesskey]", width: "80px", label: b.acccessKey, maxLength: 1, setup: k, commit: m}
|
||||
]},
|
||||
{type: "hbox", widths: ["45%", "35%", "20%"], children: [
|
||||
{type: "text", label: b.name, id: "advName", requiredContent: "a[name]", setup: k, commit: m},
|
||||
{type: "text", label: b.langCode, id: "advLangCode", requiredContent: "a[lang]", width: "110px", "default": "", setup: k, commit: m},
|
||||
{type: "text", label: b.tabIndex, id: "advTabIndex", requiredContent: "a[tabindex]", width: "80px", maxLength: 5, setup: k, commit: m}
|
||||
]}
|
||||
]},
|
||||
{type: "vbox", padding: 1, children: [
|
||||
{type: "hbox", widths: ["45%", "55%"], children: [
|
||||
{type: "text", label: b.advisoryTitle, requiredContent: "a[title]", "default": "", id: "advTitle", setup: k, commit: m},
|
||||
{type: "text", label: b.advisoryContentType, requiredContent: "a[type]", "default": "", id: "advContentType", setup: k, commit: m}
|
||||
]},
|
||||
{type: "hbox", widths: ["45%", "55%"], children: [
|
||||
{type: "text", label: b.cssClasses,
|
||||
requiredContent: "a(cke-xyz)", "default": "", id: "advCSSClasses", setup: k, commit: m},
|
||||
{type: "text", label: b.charset, requiredContent: "a[charset]", "default": "", id: "advCharset", setup: k, commit: m}
|
||||
]},
|
||||
{type: "hbox", widths: ["45%", "55%"], children: [
|
||||
{type: "text", label: b.rel, requiredContent: "a[rel]", "default": "", id: "advRel", setup: k, commit: m},
|
||||
{type: "text", label: b.styles, requiredContent: "a{cke-xyz}", "default": "", id: "advStyles", validate: CKEDITOR.dialog.validate.inlineStyle(n.lang.common.invalidInlineStyle), setup: k, commit: m}
|
||||
]}
|
||||
]}
|
||||
]}
|
||||
],
|
||||
onShow: function () {
|
||||
var a = this.getParentEditor(), b = a.getSelection(), c = null;
|
||||
(c = w.getSelectedLink(a)) && c.hasAttribute("href") ? b.getSelectedElement() || b.selectElement(c) : c = null;
|
||||
this.setupContent(I.apply(this, [a, c]))
|
||||
}, onOk: function () {
|
||||
var a = {}, b = [], c = {}, d = this.getParentEditor();
|
||||
this.commitContent(c);
|
||||
switch (c.type || "url") {
|
||||
case "url":
|
||||
var e = c.url && c.url.protocol != void 0 ? c.url.protocol : "http://", i = c.url && CKEDITOR.tools.trim(c.url.url) || "";
|
||||
a["data-cke-saved-href"] = i.indexOf("/") === 0 ? i : e + i;
|
||||
break;
|
||||
case "anchor":
|
||||
e =
|
||||
c.anchor && c.anchor.id;
|
||||
a["data-cke-saved-href"] = "#" + (c.anchor && c.anchor.name || e || "");
|
||||
break;
|
||||
case "email":
|
||||
var f = c.email, e = f.address;
|
||||
switch (o) {
|
||||
case "":
|
||||
case "encode":
|
||||
var i = encodeURIComponent(f.subject || ""), h = encodeURIComponent(f.body || ""), f = [];
|
||||
i && f.push("subject=" + i);
|
||||
h && f.push("body=" + h);
|
||||
f = f.length ? "?" + f.join("&") : "";
|
||||
if (o == "encode") {
|
||||
e = ["javascript:void(location.href='mailto:'+", u(e)];
|
||||
f && e.push("+'", r(f), "'");
|
||||
e.push(")")
|
||||
} else e = ["mailto:", e, f];
|
||||
break;
|
||||
default:
|
||||
e = e.split("@", 2);
|
||||
f.name = e[0];
|
||||
f.domain = e[1];
|
||||
e =
|
||||
["javascript:", t(f)]
|
||||
}
|
||||
a["data-cke-saved-href"] = e.join("")
|
||||
}
|
||||
if (c.target)if (c.target.type == "popup") {
|
||||
for (var e = ["window.open(this.href, '", c.target.name || "", "', '"], j = ["resizable", "status", "location", "toolbar", "menubar", "fullscreen", "scrollbars", "dependent"], i = j.length, f = function (a) {
|
||||
c.target[a] && j.push(a + "=" + c.target[a])
|
||||
}, h = 0; h < i; h++)j[h] = j[h] + (c.target[j[h]] ? "=yes" : "=no");
|
||||
f("width");
|
||||
f("left");
|
||||
f("height");
|
||||
f("top");
|
||||
e.push(j.join(","), "'); return false;");
|
||||
a["data-cke-pa-onclick"] = e.join("");
|
||||
b.push("target")
|
||||
} else {
|
||||
c.target.type !=
|
||||
"notSet" && c.target.name ? a.target = c.target.name : b.push("target");
|
||||
b.push("data-cke-pa-onclick", "onclick")
|
||||
}
|
||||
if (c.adv) {
|
||||
e = function (d, e) {
|
||||
var f = c.adv[d];
|
||||
f ? a[e] = f : b.push(e)
|
||||
};
|
||||
e("advId", "id");
|
||||
e("advLangDir", "dir");
|
||||
e("advAccessKey", "accessKey");
|
||||
c.adv.advName ? a.name = a["data-cke-saved-name"] = c.adv.advName : b = b.concat(["data-cke-saved-name", "name"]);
|
||||
e("advLangCode", "lang");
|
||||
e("advTabIndex", "tabindex");
|
||||
e("advTitle", "title");
|
||||
e("advContentType", "type");
|
||||
e("advCSSClasses", "class");
|
||||
e("advCharset", "charset");
|
||||
e("advStyles",
|
||||
"style");
|
||||
e("advRel", "rel")
|
||||
}
|
||||
e = d.getSelection();
|
||||
a.href = a["data-cke-saved-href"];
|
||||
if (this._.selectedElement) {
|
||||
d = this._.selectedElement;
|
||||
i = d.data("cke-saved-href");
|
||||
f = d.getHtml();
|
||||
d.setAttributes(a);
|
||||
d.removeAttributes(b);
|
||||
c.adv && (c.adv.advName && CKEDITOR.plugins.link.synAnchorSelector) && d.addClass(d.getChildCount() ? "cke_anchor" : "cke_anchor_empty");
|
||||
if (i == f || c.type == "email" && f.indexOf("@") != -1) {
|
||||
d.setHtml(c.type == "email" ? c.email.address : a["data-cke-saved-href"]);
|
||||
e.selectElement(d)
|
||||
}
|
||||
delete this._.selectedElement
|
||||
} else {
|
||||
e =
|
||||
e.getRanges()[0];
|
||||
if (e.collapsed) {
|
||||
d = new CKEDITOR.dom.text(c.type == "email" ? c.email.address : a["data-cke-saved-href"], d.document);
|
||||
e.insertNode(d);
|
||||
e.selectNodeContents(d)
|
||||
}
|
||||
d = new CKEDITOR.style({element: "a", attributes: a});
|
||||
d.type = CKEDITOR.STYLE_INLINE;
|
||||
d.applyToRange(e);
|
||||
e.select()
|
||||
}
|
||||
}, onLoad: function () {
|
||||
n.config.linkShowAdvancedTab || this.hidePage("advanced");
|
||||
n.config.linkShowTargetTab || this.hidePage("target")
|
||||
}, onFocus: function () {
|
||||
var a = this.getContentElement("info", "linkType");
|
||||
if (a && a.getValue() == "url") {
|
||||
a = this.getContentElement("info",
|
||||
"url");
|
||||
a.select()
|
||||
}
|
||||
}}
|
||||
});
|
|
@ -696,7 +696,6 @@ ul.user_course_sort li{list-style-type:none;
|
|||
height:auto;}
|
||||
|
||||
|
||||
|
||||
.info-break{
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
|
@ -1765,6 +1764,22 @@ input#content_comments {width: 99%}
|
|||
|
||||
p.pagination {margin-top:8px; font-size: 90%}
|
||||
|
||||
|
||||
ul.courses {margin:0px; padding-left:0em;}
|
||||
ul.courses ul {padding-left:1.6em;}
|
||||
ul.courses.root {margin:0; padding:0;}
|
||||
|
||||
ul.courses li {list-style-type:none;}
|
||||
|
||||
ul.courses li {list-style-type:none;}
|
||||
#courses-index ul.courses ul.courses { border-left: 3px solid #e0e0e0; padding-left:1em;}
|
||||
#courses-index ul.courses li.root {margin-bottom: 1em;}
|
||||
#courses-index ul.courses li.child {margin-top: 1em;}
|
||||
#courses-index ul.courses div.root a.course {font-family:'微软雅黑', "Trebuchet MS", Verdana, sans-serif; font-weight: bold; font-size: 14px; margin: 0 0 10px 0; }
|
||||
.my-course { padding-left: 18px; background: url(../images/fav.png) no-repeat 0 50%; }
|
||||
|
||||
|
||||
|
||||
/***** Tabular forms ******/
|
||||
.tabular p{
|
||||
margin: 0;
|
||||
|
|
|
@ -50,7 +50,7 @@ only screen and (min-device-pixel-ratio: 2) {
|
|||
|
||||
body,#wrapper
|
||||
{
|
||||
background-color:#fff; /*整体背景色ecfffb*/
|
||||
background-color:#F6F7F8;/*fff整体背景色ecfffb*/
|
||||
font-family:'微软雅黑',Helvetica,Arial,"Lucida Grande",verdana,sans-serif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue