Merge branch 'nccu_master' into demo_site
Conflicts: Gemfile app/assets/javascripts/tinymce_orbit.js.erb app/assets/stylesheets/style.css.erb app/controllers/admin/assets_controller.rb app/controllers/admin/module_apps_new_interface_controller.rb app/controllers/admin/page_parts_controller.rb app/jobs/sync_db.rb app/models/page.rb app/models/page_part.rb app/models/user/user.rb app/uploaders/image_uploader.rb app/views/admin/assets/create.js.erb app/views/admin/module_apps/reload_frontend_pages.js.erb app/views/layouts/_orbit_bar.html.erb app/views/layouts/_side_bar.html.erb app/views/layouts/_users_checkbox_ary.html.erb app/views/shared/_privilege_user.html.erb config/mongoid.yml lib/parsers/parser_common.rb vendor/built_in_modules/announcement/announcement.json vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_link.html.erb vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_privilege_user.html.erb vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_index.html.erb
This commit is contained in:
commit
7d5531bf01
432 files changed
+8773
-17035
No files matched your search
@@ -1,7 +0,0 @@
|
||||
$(document).on('click', '#ajax_form_submit', function(){
|
||||
$('#ajaxForm').ajaxSubmit({
|
||||
beforeSubmit: function(a,f,o) {
|
||||
o.dataType = 'script';
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,111 @@
|
||||
<%#= encoding: utf-8 %>
|
||||
$(document).on('click', '#ajax_form_submit', function(){
|
||||
// $('#ajaxForm').ajaxSubmit({
|
||||
// beforeSubmit: function(a,f,o) {
|
||||
// o.dataType = 'script';
|
||||
// if (o.dataType == 'script') {
|
||||
// o.url = o.url.split('?'); // split on GET params
|
||||
// if (o.url[0].substr(-3) != '.js') o.url[0] += '.js'; // force rails to respond to respond to the request with :format = js
|
||||
// o.url = o.url.join('?'); // join on GET params
|
||||
// }
|
||||
// },
|
||||
// success: function(response,status,xhr){
|
||||
// alert(response);
|
||||
// alert(status);
|
||||
// alert(xhr);
|
||||
// },
|
||||
// error:function(){
|
||||
// alert("error");
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
var o = {
|
||||
// dataType: 'script',
|
||||
dataType: 'html',
|
||||
url:$("#ajaxForm").attr("action"),
|
||||
beforeSubmit: function(){
|
||||
var sub = true;
|
||||
$("span.error").remove();
|
||||
$("#dyn_error").empty();
|
||||
$("#ajaxForm input").each(function(){
|
||||
if($(this).val() == ""){
|
||||
$("<span class='error'> *</span>").insertAfter($(this));
|
||||
sub = false;
|
||||
}
|
||||
})
|
||||
if(!sub){
|
||||
$("#dyn_error").text("Cannot be empty.");
|
||||
$("#dyn_error").text("<%= I18n.t('cant_empty_star') %>");
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success: function(response,status,xhr){
|
||||
if(typeof tinyMCEPopup != "undefined"){
|
||||
var x = response.split("#");
|
||||
var returnurl = x[0],
|
||||
returntitle = x[1],
|
||||
returndescription = x[2];
|
||||
var win = tinyMCEPopup.getWindowArg("window");
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = returnurl;
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("alt")).value = returndescription;
|
||||
win.document.getElementById(tinyMCEPopup.getWindowArg("title")).value = returntitle;
|
||||
if (typeof(win.ImageDialog) != "undefined") {
|
||||
// we are, so update image dimensions...
|
||||
if (win.ImageDialog.getImageData)
|
||||
win.ImageDialog.getImageData();
|
||||
|
||||
// ... and preview if necessary
|
||||
if (win.ImageDialog.showPreviewImage)
|
||||
win.ImageDialog.showPreviewImage(returnurl);
|
||||
}
|
||||
tinyMCEPopup.close();
|
||||
}else{
|
||||
//incase if we want to do something for quick edit file upload
|
||||
// var modalvalues = "";
|
||||
// var r = "";
|
||||
// if(rcom.getInternetExplorerVersion() > -1){
|
||||
// r = "<tr><td>" + response + "</td></tr>";
|
||||
// r = r.replace("**","</td><td>");
|
||||
// r = r.replace("**","</td><td>");
|
||||
// r = $(r);
|
||||
// modalvalues = r.find("span").attr("data-content").split("#");
|
||||
// r.attr("id",r.find("span").attr("for"));
|
||||
// var table=document.getElementById(modalvalues[0]);
|
||||
// //var tbody = table.getElementsByTagName("tbody");
|
||||
// var row = table.insertRow(table.rows.length-1);
|
||||
// var c1 = row.insertCell(0),
|
||||
// c2 = row.insertCell(1),
|
||||
// c3 = row.insertCell(2);
|
||||
// c1.innerHTML = r.find("td").eq(0).html();
|
||||
// c2.innerHTML = r.find("td").eq(1).html();
|
||||
// c3.innerHTML = r.find("td").eq(2).html();
|
||||
// var trow = $("#bulletin_files tfoot").find("tr").eq(0);
|
||||
// $("#bulletin_files tbody").append(trow);
|
||||
// }else{
|
||||
|
||||
// response = response.replace("**","");
|
||||
// response = response.replace("**","");
|
||||
// r = $(response);
|
||||
// modalvalues = r.find("span").attr("data-content").split("#");
|
||||
// $('#' + modalvalues[0]+ ' tbody').append(r);
|
||||
// }
|
||||
// console.log(modalvalues[1]);
|
||||
// $("#"+modalvalues[1]).modal('hide');
|
||||
//$('#bulletin_files tbody').append(r);
|
||||
//$(response).fadeIn();
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
alert("error");
|
||||
}
|
||||
}
|
||||
|
||||
if (o.dataType == 'script') {
|
||||
o.url = o.url.split('?'); // split on GET params
|
||||
if (o.url[0].substr(-3) != '.js') o.url[0] += '.js'; // force rails to respond to respond to the request with :format = js
|
||||
o.url = o.url.join('?'); // join on GET params
|
||||
}
|
||||
$('#ajaxForm').ajaxSubmit(o);
|
||||
|
||||
});
|
||||
@@ -6,4 +6,5 @@
|
||||
//
|
||||
//= require jquery
|
||||
//= require jquery_ujs
|
||||
//= require_tree .
|
||||
//= require_tree .
|
||||
//= social-share-button
|
||||
Vendored
+2
-3
@@ -129,7 +129,6 @@
|
||||
|
||||
var that = this
|
||||
this.isShown = false
|
||||
//alert(this.isShown+":"+this.$element.attr('class'))
|
||||
|
||||
$('body').removeClass('modal-open')
|
||||
|
||||
@@ -1250,8 +1249,8 @@
|
||||
var that = this
|
||||
, complete = function () {
|
||||
if (startEvent == 'show') that.reset()
|
||||
that.$element.trigger(completeEvent)
|
||||
mainTablePosition();
|
||||
that.$element.trigger(completeEvent)
|
||||
setTimeout(mainTablePosition,150);
|
||||
}
|
||||
|
||||
this.$element
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
<%#= encoding: utf-8 %>
|
||||
$(document).ready(function(){
|
||||
//alert("Anc Loaded");
|
||||
$('.bulletin_links_block a.delete').live('click', function(){
|
||||
$(this).parents('.list_item').remove();
|
||||
});
|
||||
@@ -7,8 +10,10 @@ $('.bulletin_files_block a.delete').live('click', function(){
|
||||
});
|
||||
|
||||
$(document).on('click', '.action a.remove_existing_record', function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr #" + $(this).prev().attr('value')).hide();
|
||||
if(confirm("<%= I18n.t('announcement.sure?')%>")){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#" + $(this).prev().attr('value')).hide();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.quick_edit_cancel', function(){
|
||||
@@ -16,4 +21,8 @@ $(document).on('click', '.quick_edit_cancel', function(){
|
||||
$('#' + tr).hide();
|
||||
$("tr#bulletin_file_" + $(this).prev().attr('value')).hide();
|
||||
$("tr#bulletin_link_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
$('.reject_info').tooltip({
|
||||
placement : 'bottom'
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* jQuery Masonry v2.1.05
|
||||
* A dynamic layout plugin for jQuery
|
||||
* The flip-side of CSS Floats
|
||||
* http://masonry.desandro.com
|
||||
*
|
||||
* Licensed under the MIT license.
|
||||
* Copyright 2012 David DeSandro
|
||||
*/
|
||||
(function(a,b,c){"use strict";var d=b.event,e;d.special.smartresize={setup:function(){b(this).bind("resize",d.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",d.special.smartresize.handler)},handler:function(a,c){var d=this,f=arguments;a.type="smartresize",e&&clearTimeout(e),e=setTimeout(function(){b.event.handle.apply(d,f)},c==="execAsap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execAsap"])},b.Mason=function(a,c){this.element=b(c),this._create(a),this._init()},b.Mason.settings={isResizable:!0,isAnimated:!1,animationOptions:{queue:!1,duration:500},gutterWidth:0,isRTL:!1,isFitWidth:!1,containerStyle:{position:"relative"}},b.Mason.prototype={_filterFindBricks:function(a){var b=this.options.itemSelector;return b?a.filter(b).add(a.find(b)):a},_getBricks:function(a){var b=this._filterFindBricks(a).css({position:"absolute"}).addClass("masonry-brick");return b},_create:function(c){this.options=b.extend(!0,{},b.Mason.settings,c),this.styleQueue=[];var d=this.element[0].style;this.originalStyle={height:d.height||""};var e=this.options.containerStyle;for(var f in e)this.originalStyle[f]=d[f]||"";this.element.css(e),this.horizontalDirection=this.options.isRTL?"right":"left",this.offset={x:parseInt(this.element.css("padding-"+this.horizontalDirection),10),y:parseInt(this.element.css("padding-top"),10)},this.isFluid=this.options.columnWidth&&typeof this.options.columnWidth=="function";var g=this;setTimeout(function(){g.element.addClass("masonry")},0),this.options.isResizable&&b(a).bind("smartresize.masonry",function(){g.resize()}),this.reloadItems()},_init:function(a){this._getColumns(),this._reLayout(a)},option:function(a,c){b.isPlainObject(a)&&(this.options=b.extend(!0,this.options,a))},layout:function(a,b){for(var c=0,d=a.length;c<d;c++)this._placeBrick(a[c]);var e={};e.height=Math.max.apply(Math,this.colYs);if(this.options.isFitWidth){var f=0;c=this.cols;while(--c){if(this.colYs[c]!==0)break;f++}e.width=(this.cols-f)*this.columnWidth-this.options.gutterWidth}this.styleQueue.push({$el:this.element,style:e});var g=this.isLaidOut?this.options.isAnimated?"animate":"css":"css",h=this.options.animationOptions,i;for(c=0,d=this.styleQueue.length;c<d;c++)i=this.styleQueue[c],i.$el[g](i.style,h);this.styleQueue=[],b&&b.call(a),this.isLaidOut=!0},_getColumns:function(){var a=this.options.isFitWidth?this.element.parent():this.element,b=a.width();this.columnWidth=this.isFluid?this.options.columnWidth(b):this.options.columnWidth||this.$bricks.outerWidth(!0)||b,this.columnWidth+=this.options.gutterWidth,this.cols=Math.floor((b+this.options.gutterWidth)/this.columnWidth),this.cols=Math.max(this.cols,1)},_placeBrick:function(a){var c=b(a),d,e,f,g,h;d=Math.ceil(c.outerWidth(!0)/this.columnWidth),d=Math.min(d,this.cols);if(d===1)f=this.colYs;else{e=this.cols+1-d,f=[];for(h=0;h<e;h++)g=this.colYs.slice(h,h+d),f[h]=Math.max.apply(Math,g)}var i=Math.min.apply(Math,f),j=0;for(var k=0,l=f.length;k<l;k++)if(f[k]===i){j=k;break}var m={top:i+this.offset.y};m[this.horizontalDirection]=this.columnWidth*j+this.offset.x,this.styleQueue.push({$el:c,style:m});var n=i+c.outerHeight(!0),o=this.cols+1-l;for(k=0;k<o;k++)this.colYs[j+k]=n},resize:function(){var a=this.cols;this._getColumns(),(this.isFluid||this.cols!==a)&&this._reLayout()},_reLayout:function(a){var b=this.cols;this.colYs=[];while(b--)this.colYs.push(0);this.layout(this.$bricks,a)},reloadItems:function(){this.$bricks=this._getBricks(this.element.children())},reload:function(a){this.reloadItems(),this._init(a)},appended:function(a,b,c){if(b){this._filterFindBricks(a).css({top:this.element.height()});var d=this;setTimeout(function(){d._appended(a,c)},1)}else this._appended(a,c)},_appended:function(a,b){var c=this._getBricks(a);this.$bricks=this.$bricks.add(c),this.layout(c,b)},remove:function(a){this.$bricks=this.$bricks.not(a),a.remove()},destroy:function(){this.$bricks.removeClass("masonry-brick").each(function(){this.style.position="",this.style.top="",this.style.left=""});var c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(".masonry").removeClass("masonry").removeData("masonry"),b(a).unbind(".masonry")}},b.fn.imagesLoaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&&b.inArray(c,g)===-1&&(g.push(c),--e<=0&&(setTimeout(h),d.unbind(".imagesLoaded",i)))}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",g=[];return e||h(),d.bind("load.imagesLoaded error.imagesLoaded",i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var f=function(b){a.console&&a.console.error(b)};b.fn.masonry=function(a){if(typeof a=="string"){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,"masonry");if(!d){f("cannot call methods on masonry prior to initialization; attempted to call method '"+a+"'");return}if(!b.isFunctiLine truncated
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* jQuery.Preload - Multifunctional preloader
|
||||
* Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com
|
||||
* Dual licensed under MIT and GPL.
|
||||
* Date: 3/25/2009
|
||||
* @author Ariel Flesler
|
||||
* @version 1.0.8
|
||||
*/
|
||||
;(function($){var h=$.preload=function(c,d){if(c.split)c=$(c);d=$.extend({},h.defaults,d);var f=$.map(c,function(a){if(!a)return;if(a.split)return d.base+a+d.ext;var b=a.src||a.href;if(typeof d.placeholder=='string'&&a.src)a.src=d.placeholder;if(b&&d.find)b=b.replace(d.find,d.replace);return b||null}),data={loaded:0,failed:0,next:0,done:0,total:f.length};if(!data.total)return finish();var g=$(Array(d.threshold+1).join('<img/>')).load(handler).error(handler).bind('abort',handler).each(fetch);function handler(e){data.element=this;data.found=e.type=='load';data.image=this.src;data.index=this.index;var a=data.original=c[this.index];data[data.found?'loaded':'failed']++;data.done++;if(d.enforceCache)h.cache.push($('<img/>').attr('src',data.image)[0]);if(d.placeholder&&a.src)a.src=data.found?data.image:d.notFound||a.src;if(d.onComplete)d.onComplete(data);if(data.done<data.total)fetch(0,this);else{if(g&&g.unbind)g.unbind('load').unbind('error').unbind('abort');g=null;finish()}};function fetch(i,a,b){if(a.attachEvent&&data.next&&data.next%h.gap==0&&!b){setTimeout(function(){fetch(i,a,1)},0);return!1}if(data.next==data.total)return!1;a.index=data.next;a.src=f[data.next++];if(d.onRequest){data.index=a.index;data.element=a;data.image=a.src;data.original=c[data.next-1];d.onRequest(data)}};function finish(){if(d.onFinish)d.onFinish(data)}};h.gap=14;h.cache=[];h.defaults={threshold:2,base:'',ext:'',replace:''};$.fn.preload=function(a){h(this,a);return this}})(jQuery);
|
||||
@@ -0,0 +1,33 @@
|
||||
window.SocialShareButton =
|
||||
openUrl : (url) ->
|
||||
window.open(url)
|
||||
false
|
||||
|
||||
share : (el) ->
|
||||
site = $(el).data('site')
|
||||
title = encodeURIComponent($(el).parent().data('title'))
|
||||
img = encodeURIComponent($(el).parent().data("img"))
|
||||
fb_url = encodeURIComponent($(el).parent().data("fb_url"))
|
||||
url = encodeURIComponent(location.href)
|
||||
switch site
|
||||
when "weibo"
|
||||
SocialShareButton.openUrl("http://v.t.sina.com.cn/share/share.php?url=#{url}&pic=#{img}&title=#{title}&content=utf-8")
|
||||
when "twitter"
|
||||
SocialShareButton.openUrl("https://twitter.com/home?status=#{title}: #{url}")
|
||||
when "douban"
|
||||
SocialShareButton.openUrl("http://www.douban.com/recommend/?url=#{url}&title=#{title}&image=#{img}")
|
||||
when "facebook"
|
||||
SocialShareButton.openUrl("http://www.facebook.com/sharer.php?t=#{title}&u=#{fb_url}")
|
||||
when "qq"
|
||||
SocialShareButton.openUrl("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=#{url}&title=#{title}&pics=#{img}")
|
||||
when "tqq"
|
||||
SocialShareButton.openUrl("http://share.v.t.qq.com/index.php?c=share&a=index&url=#{url}&title=#{title}&pic=#{img}")
|
||||
when "baidu"
|
||||
SocialShareButton.openUrl("http://apps.hi.baidu.com/share/?url=#{url}&title=#{title}&content=")
|
||||
when "kaixin001"
|
||||
SocialShareButton.openUrl("http://www.kaixin001.com/rest/records.php?url=#{url}&content=#{title}&style=11&pic=#{img}")
|
||||
when "renren"
|
||||
SocialShareButton.openUrl("http://widget.renren.com/dialog/share?resourceUrl=#{url}&title=#{title}&description=")
|
||||
when "google_plus"
|
||||
SocialShareButton.openUrl("https://plus.google.com/share?url=#{url}&t=#{title}")
|
||||
false
|
||||
+12
-2
@@ -1,3 +1,7 @@
|
||||
<%#= encoding: utf-8 %>
|
||||
$(document).ready(function(){
|
||||
//alert("News Loaded");
|
||||
|
||||
$('.news_bulletin_links_block a.delete').live('click', function(){
|
||||
$(this).parents('.list_item').remove();
|
||||
});
|
||||
@@ -7,8 +11,10 @@ $('.news_bulletin_files_block a.delete').live('click', function(){
|
||||
});
|
||||
|
||||
$(document).on('click', '.action a.remove_existing_record', function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr #" + $(this).prev().attr('value')).hide();
|
||||
if(confirm("<%= I18n.t('news.sure?')%>")){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#" + $(this).prev().attr('value')).hide();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '.quick_edit_cancel', function(){
|
||||
@@ -16,4 +22,8 @@ $(document).on('click', '.quick_edit_cancel', function(){
|
||||
$('#' + tr).hide();
|
||||
$("tr#news_bulletin_file_" + $(this).prev().attr('value')).hide();
|
||||
$("tr#news_bulletin_link_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
$('.reject_info').tooltip({
|
||||
placement : 'bottom'
|
||||
});
|
||||
});
|
||||
@@ -1,7 +0,0 @@
|
||||
$(document).on('click', '.list-remove', function(){
|
||||
$('#delete_all').submit();
|
||||
});
|
||||
|
||||
$(document).on('click', '#check_all', function(){
|
||||
$('.checkbox_in_list').attr("checked", this.checked);
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
<%#= encoding: utf-8 %>
|
||||
$(document).on('click', '.list-remove', function(){
|
||||
if(confirm("<%= I18n.t('sure?') %>")){
|
||||
var a = [];
|
||||
$('.checkbox_in_list').each(function(){
|
||||
if (this.checked) a.push("ids[]=" + this.value);
|
||||
});
|
||||
var url = $(this).attr('rel');
|
||||
if (url.indexOf('?') > -1){
|
||||
$.getScript(url + '&' + a.join('&'));
|
||||
}else{
|
||||
$.getScript(url + '?' + a.join('&'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#check_all', function(){
|
||||
$('.checkbox_in_list').attr("checked", this.checked);
|
||||
});
|
||||
@@ -47,7 +47,7 @@ function myFileBrowser(field_name, url, type, win) {
|
||||
var cmsURL = window.location.toString();
|
||||
cmsURL = cmsURL.split("/");
|
||||
cmsURL = "<%= Rails.application.routes.url_helpers.file_upload_admin_assets_path %>";
|
||||
|
||||
|
||||
// script URL - use an absolute path!
|
||||
if (cmsURL.indexOf("?") < 0) {
|
||||
//add the type as the only query parameter
|
||||
|
||||
Reference in new issue
Block a user