Merge branch 'new_member' of github.com:Rulingcom/orbit into new_member
Conflicts: app/helpers/attribute_fields_helper.rb app/views/admin/infos/_form.html.erb config/locales/zh_tw.yml
This commit is contained in:
commit
b4a2737407
373 files changed
+10342
-6551
No files matched your search
@@ -1,7 +1,7 @@
|
||||
$('#ajaxForm').ajaxForm({
|
||||
beforeSubmit: function(a,f,o) {
|
||||
o.dataType = 'script';
|
||||
},
|
||||
success: function(data) {
|
||||
}
|
||||
beforeSubmit: function(a,f,o) {
|
||||
o.dataType = 'script';
|
||||
},
|
||||
success: function(data) {
|
||||
}
|
||||
});
|
||||
@@ -10,7 +10,7 @@ $('.bulletin_files_block a.delete').live('click', function(){
|
||||
});
|
||||
|
||||
$(document).on('click', '.action a.remove_existing_record', function(){
|
||||
if(confirm("<%= I18n.t('announcement.sure?')%>")){
|
||||
if(confirm("<%= I18n.t(:sure?)%>")){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#" + $(this).prev().attr('value')).hide();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
jQuery(document).ajaxStart(function(){
|
||||
$('<div class="modal-backdrop fade in" id="sys_modal"><img src="/assets/ajax-loader.gif" style="margin-top: 25%;margin-left: 50%;"></div>').appendTo('body');
|
||||
});
|
||||
// jQuery(document).ajaxStart(function(){
|
||||
// $('<div class="modal-backdrop fade in" id="sys_modal"><img src="/assets/ajax-loader.gif" style="margin-top: 25%;margin-left: 50%;"></div>').appendTo('body');
|
||||
// });
|
||||
|
||||
jQuery(document).ajaxComplete(function(){
|
||||
$("#sys_modal").hide().remove();
|
||||
});
|
||||
// jQuery(document).ajaxComplete(function(){
|
||||
// $("#sys_modal").hide().remove();
|
||||
// });
|
||||
@@ -3,6 +3,58 @@
|
||||
// <%= link_to "NewPreview", realtime_preview_admin_ad_banner_path(ad_banner_tab) , :class=>'preview_trigger'%>
|
||||
|
||||
$(document).ready(function() {
|
||||
// $(".post_preview").click(function(e){
|
||||
// $("#main-wrap").after("<span id='show_preview'></span>");
|
||||
// e.preventDefault();
|
||||
// var form = $(this).parents("form").first()
|
||||
// //var cont = form["content"].value;
|
||||
// // $.ajax({
|
||||
// // type: 'POST',
|
||||
// // url: $(this).attr("href")+'?preview=true',
|
||||
// // data: form.serialize(),
|
||||
// // dataType: "script",
|
||||
// // success: function (msg) {
|
||||
// // $("#"+start_modal_with_id).modal('show'); },
|
||||
// // error: function(){
|
||||
// // alert("ERROR");
|
||||
// // }
|
||||
// // });
|
||||
// url = "/panel/news/back_end/news_bulletins/preview?preview=true"
|
||||
// // alert(url)
|
||||
// form.attr("action",url);
|
||||
// form.submit();
|
||||
// //return false;
|
||||
// });
|
||||
$("button.post_preview").click(function(){
|
||||
var btn = document.getElementById("button_for_preview");
|
||||
var attrs = btn.attributes;
|
||||
var url = attrs['url'];
|
||||
// url = url.replace("url=","");
|
||||
$("form.nccu_ajax_form").ajaxSubmit({
|
||||
beforeSubmit: function(a,f,o){
|
||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||
o.dataType = 'script';
|
||||
o.url = url.nodeValue;
|
||||
o.type = 'post';
|
||||
},success: function(msg) { }
|
||||
|
||||
});
|
||||
})
|
||||
// $("form.nccu_ajax_form").ajaxForm({
|
||||
// beforeSubmit: function(a,f,o) {
|
||||
// // if(clicked_what.hasClass("post_preview")){
|
||||
// // $("#main-wrap").after("<span id='show_preview'></span>");
|
||||
// // o.dataType = 'script';
|
||||
// // o.url = clicked_what.attr("url");
|
||||
// // }
|
||||
// },
|
||||
// success: function(data) {
|
||||
// // if(!clicked_what.hasClass("post_preview")){
|
||||
// // window.location = data.redirect_url;
|
||||
// // }
|
||||
// }
|
||||
// })
|
||||
|
||||
$("a.preview_trigger").click(function(){
|
||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||
$.ajax({
|
||||
|
||||
@@ -4,33 +4,45 @@
|
||||
|
||||
//extended jquery to search fast.
|
||||
$.extend($.expr[':'], {
|
||||
'containsi': function (elem, i, match, array) {
|
||||
return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
|
||||
}
|
||||
'containsi': function (elem, i, match, array) {
|
||||
return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
|
||||
}
|
||||
});
|
||||
var interval,sval;
|
||||
$(document).ready(function(){
|
||||
$("#user_filter").keyup(function(e){
|
||||
if((e.which>96 && e.which<123) || (e.which>64 && e.which<92) || (e.which == 32) || (e.which == 8)){
|
||||
sval = $(this).val();
|
||||
$(".checkbox").popover("hide");
|
||||
$("div.checkblock").hide();
|
||||
clearInterval(interval);
|
||||
interval = setInterval(waitForSearch,1000);
|
||||
}
|
||||
})
|
||||
$("#user_filter").keyup(function(e){
|
||||
if((e.which>96 && e.which<123) || (e.which>64 && e.which<92) || (e.which == 32) || (e.which == 8)){
|
||||
sval = $(this).val();
|
||||
$(".checkbox").popover("hide");
|
||||
$("div.checkblock").hide();
|
||||
clearInterval(interval);
|
||||
interval = setInterval(waitForSearch,1000);
|
||||
}
|
||||
})
|
||||
})
|
||||
var waitForSearch = function(){
|
||||
if(sval){
|
||||
var totalfoundbyname = $("div#users_checkbox_ary label.member-name:containsi("+sval+")").length
|
||||
if(totalfoundbyname!=0){
|
||||
$("div#users_checkbox_ary label.member-name:containsi("+sval+")").parent().parent().show();
|
||||
}else if(totalfoundbyname==0){
|
||||
$("div#users_checkbox_ary div.for_unit:containsi("+sval+")").parent().show();
|
||||
}
|
||||
}else{
|
||||
$(".checkbox").popover('hide');
|
||||
$("div.checkblock").show();
|
||||
}
|
||||
clearInterval(interval);
|
||||
if(sval){
|
||||
var re1 = new RegExp("^[\u4E00-\uFA29]*$"); //Chinese character range
|
||||
var re2 = new RegExp("^[\uE7C7-\uE7F3]*$");
|
||||
if ((re1.test(sval) && (re2.test(sval)))){
|
||||
|
||||
var totalfoundbyname = $("div#users_checkbox_ary label.member-name:contains("+sval+")").length
|
||||
if(totalfoundbyname!=0){
|
||||
$("div#users_checkbox_ary label.member-name:contains("+sval+")").parent().parent().show();
|
||||
}else if(totalfoundbyname==0){
|
||||
$("div#users_checkbox_ary div.for_unit:contains("+sval+")").parent().show();
|
||||
}
|
||||
}else{
|
||||
var totalfoundbyname = $("div#users_checkbox_ary label.member-name:containsi("+sval+")").length
|
||||
if(totalfoundbyname!=0){
|
||||
$("div#users_checkbox_ary label.member-name:containsi("+sval+")").parent().parent().show();
|
||||
}else if(totalfoundbyname==0){
|
||||
$("div#users_checkbox_ary div.for_unit:containsi("+sval+")").parent().show();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$(".checkbox").popover('hide');
|
||||
$("div.checkblock").show();
|
||||
}
|
||||
clearInterval(interval);
|
||||
}
|
||||
@@ -40,11 +40,11 @@ $(".nav-tabs").find(".icons-pencil").click(function(){
|
||||
data: { body: content_holder.html() },
|
||||
success: function(json) {
|
||||
$(selector).attr("contenteditable",false)
|
||||
alert("<%= I18n.t('admin.contenteditable.update_done') %>");
|
||||
alert("<%= I18n.t('update.success_') %>");
|
||||
//content_holder.effect('highlight', {'color': '#0f0'}, 3000);
|
||||
},
|
||||
error: function() {
|
||||
alert("<%= I18n.t('admin.contenteditable.update_failed') %>");
|
||||
alert("<%= I18n.t('update.fail') %>");
|
||||
//content_holder.effect('highlight', {'color': '#f00'}, 3000);
|
||||
content_holder.html(content);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ $('.news_bulletin_files_block a.delete').live('click', function(){
|
||||
});
|
||||
|
||||
$(document).on('click', '.action a.remove_existing_record', function(){
|
||||
if(confirm("<%= I18n.t('news.sure?')%>")){
|
||||
if(confirm("<%= I18n.t(:sure?)%>")){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#" + $(this).prev().attr('value')).hide();
|
||||
}
|
||||
|
||||
@@ -332,9 +332,9 @@ var orbitDesktop = function(dom){
|
||||
if(j==0)$group.attr("id",tile.group_id);
|
||||
|
||||
if(tile.data_category == "app")
|
||||
$li = $('<li id="'+tile._id+'" class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><a href="'+tile.data_content+'" class="appicon" onclick="return false;"><img src="'+o.iconPath+tile.data_content+'.png" alt="" ></a><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
|
||||
$li = $('<li data-id="'+tile.id+'" class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'" ><span class="tile '+tilecolor+' '+op+'"></span><a href="'+tile.data_content+'" class="appicon" onclick="return false;"><img src="'+o.iconPath+tile.data_content+'.png" alt="" ></a><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
|
||||
else
|
||||
$li = $('<li id="'+tile._id+'" class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><h1 class="appname thmtxt">'+tile.title+'</h1><div class="appholder">Loading...</div></li>');
|
||||
$li = $('<li data-id="'+tile.id+'" class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'" js-link="'+tile.js[0].url+'" css-link="'+tile.css.url+'"><span class="tile '+tilecolor+' '+op+'"></span><h1 class="appname thmtxt">'+tile.title+'</h1><div class="appholder">Loading...</div></li>');
|
||||
|
||||
$group.find('.col'+colindex).append($li);
|
||||
}
|
||||
@@ -1557,10 +1557,10 @@ var orbitDesktop = function(dom){
|
||||
var widget = $(this);
|
||||
if(widget.attr("data-category")=="widget"){
|
||||
var widgename = widget.attr("data-content");
|
||||
$.getScript("/desktop_widgets/"+widgename+"/"+widgename+".js",function(){
|
||||
widget.find("div.appholder").load("/desktop_widgets/"+widgename+"/index.html.erb");
|
||||
$.getScript(widget.attr("js-link"),function(){
|
||||
widget.find("div.appholder").load(widget.attr("data-content"));
|
||||
});
|
||||
// $(this).find("div.appholder").append( $('<link rel="stylesheet" id="dyn_css" type="text/css" />').attr('href', "/desktop_widgets/"+widgename+"/css/"+widgename+".css"));
|
||||
$(this).find("div.appholder").append( '<link rel="stylesheet" id="dyn_css" href="'+widget.attr("css-link")+'" type="text/css" />')
|
||||
}
|
||||
|
||||
})
|
||||
@@ -1697,3 +1697,4 @@ orbitDesktop.prototype.currentUsername = "Harry";
|
||||
var uselessfunction = function(){
|
||||
$.post("/desktop/temp_func",{sectionid:"4f83e7bbbd98eb041600001d"});
|
||||
}
|
||||
|
||||
@@ -14,17 +14,20 @@ function load_tinymce() {
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_statusbar_location : "bottom",
|
||||
theme_advanced_resizing : true,
|
||||
relative_urls : false,
|
||||
|
||||
// Skin options
|
||||
skin : "o2k7",
|
||||
skin_variant : "silver",
|
||||
|
||||
font_size_style_values : "xx-small,x-small,small,medium,large,x-large,xx-large",
|
||||
// Drop lists for link/image/media/template dialogs
|
||||
template_external_list_url : "js/template_list.js",
|
||||
// external_link_list_url : "js/link_list.js",
|
||||
// external_image_list_url : "js/image_list.js",
|
||||
// media_external_list_url : "js/media_list.js"
|
||||
|
||||
content_css: "<%= asset_path('tinymce_orbit.css') %>",
|
||||
|
||||
// Style formats
|
||||
style_formats : [
|
||||
{title : 'Bold text', inline : 'b'},
|
||||
@@ -40,7 +43,15 @@ function load_tinymce() {
|
||||
template_replace_values : {
|
||||
username : "Some User",
|
||||
staffid : "991234"
|
||||
}
|
||||
},
|
||||
|
||||
// Valide HTML elements
|
||||
valid_elements : '*[*]',
|
||||
valid_children : '*[*]',
|
||||
|
||||
// Height & width
|
||||
height : '400',
|
||||
width : '100%'
|
||||
});
|
||||
}
|
||||
function myFileBrowser(field_name, url, type, win) {
|
||||
|
||||
Reference in new issue
Block a user