Modify assets

Each layout has a manifest for css and js
This commit is contained in:
chris2tof committed 2011-12-05 09:54:41 +08:00
1 parent a0ec38ca99
commit 75a3c4d5b1
42 files changed
+571 -1488

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
+1 -31
View File
@@ -6,34 +6,4 @@
//
//= require jquery
//= require jquery_ujs
//= require_tree .
// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
$(function () {
$('#panel_sidebar a, #panel_main a.nav').live('click',
function () {
$.getScript(this.href);
history.pushState(null, document.title, this.href);
return false;
}
);
$('#panel_main a.reload').live('click',
function () {
$.getScript(this.href);
history.replaceState(null, document.title, this.href);
return false;
}
);
$('.form').live('submit', function () {
$.post(this.action, $(this).serialize(), null, 'script');
return false;
});
$(window).bind("popstate", function () {
$.getScript(location.href);
});
});
//= require_tree .
+71 -2
View File
@@ -1,2 +1,71 @@
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
function r_editor(tgetUrl,tpostUrl,tfilename,toption){
if(!toption){ toption =new Array();}
if(!toption['width']){toption['width']=400;}
if(!toption['height']){toption['height']=300;}
var editor = this;
editor.filename = tfilename;
editor.getUrl = tgetUrl;
editor.postUrl = tpostUrl;
editor.nodeToBeChanged=""
editor.width = toption['width'];
editor.height = toption['height'];
var html='';
editor.init = function(){
code = "<span id='file_editor' style='border:solid; width:"+editor.width+"px;height:"+editor.height+"px; float:right;' ><textarea style='height:87%;width:97%;resize:none;border:none;' ></textarea><input type='button' class='send' value='Send' ><input type='button' class='discard' value='Discard' ></span>";
html = $(code);
html.children("textarea").load(editor.getUrl);
html.children("input.discard").click(function(){
editor.destroy();
});
html.children("input.send").click(function(){
editor.send();
});
return html;
};
editor.reload = function(){
$.get(editor.getUrl,function(data){
html.children("textarea").text(data);
});
};
editor.send = function(){
$.post(editor.postUrl,{filename:editor.filename,context:html.children("textarea").val(),authenticity_token:$('meta[name=csrf-token]').attr('content')},null,"script");
};
editor.destroy = function(){
html.remove();
};
}
$(".r_edit").live("click",function(){
new_editor = new r_editor($(this).attr("path"),"edit_file",$(this).attr("filename"));
$(this).after(new_editor.init());
});
$(".r_snapshot").live({
mouseenter:
function(){
$(this).append($("<span></span>").html('<p class="z-preview"><img src="'+$(this).attr("path")+'"width="220" height="19" /></p>'));
},
mouseleave:
function(){
$(this).find("span:last").remove();
}
}
);
$('input.multi_files').live("change", function(){
$(this).parent().prev("ul").append("<li>" + $(this).val() + "</li>");
new_node = $(this).parent().clone();
$(this).parent().css("display","none");
new_node.children('input.multi_files').val("");
$(this).parent().before(new_node);
});
$('a.remove_mark').live("click",function(){
$(this).prev("input").val("true");
$(this).parent().css("text-decoration","line-through")
$(this).parent().removeClass("r_snapshot");
$(this).next().remove();
$(this).remove();
return false;
});
-71
View File
@@ -1,71 +0,0 @@
function r_editor(tgetUrl,tpostUrl,tfilename,toption){
if(!toption){ toption =new Array();}
if(!toption['width']){toption['width']=400;}
if(!toption['height']){toption['height']=300;}
var editor = this;
editor.filename = tfilename;
editor.getUrl = tgetUrl;
editor.postUrl = tpostUrl;
editor.nodeToBeChanged=""
editor.width = toption['width'];
editor.height = toption['height'];
var html='';
editor.init = function(){
code = "<span id='file_editor' style='border:solid; width:"+editor.width+"px;height:"+editor.height+"px; float:right;' ><textarea style='height:87%;width:97%;resize:none;border:none;' ></textarea><input type='button' class='send' value='Send' ><input type='button' class='discard' value='Discard' ></span>";
html = $(code);
html.children("textarea").load(editor.getUrl);
html.children("input.discard").click(function(){
editor.destroy();
});
html.children("input.send").click(function(){
editor.send();
});
return html;
};
editor.reload = function(){
$.get(editor.getUrl,function(data){
html.children("textarea").text(data);
});
};
editor.send = function(){
$.post(editor.postUrl,{filename:editor.filename,context:html.children("textarea").val(),authenticity_token:$('meta[name=csrf-token]').attr('content')},null,"script");
};
editor.destroy = function(){
html.remove();
};
}
$(".r_edit").live("click",function(){
new_editor = new r_editor($(this).attr("path"),"edit_file",$(this).attr("filename"));
$(this).after(new_editor.init());
});
$(".r_snapshot").live({
mouseenter:
function(){
$(this).append($("<span></span>").html('<p class="z-preview"><img src="'+$(this).attr("path")+'"width="220" height="19" /></p>'));
},
mouseleave:
function(){
$(this).find("span:last").remove();
}
}
);
$('input.multi_files').live("change", function(){
$(this).parent().prev("ul").append("<li>" + $(this).val() + "</li>");
new_node = $(this).parent().clone();
$(this).parent().css("display","none");
new_node.children('input.multi_files').val("");
$(this).parent().before(new_node);
});
$('a.remove_mark').live("click",function(){
$(this).prev("input").val("true");
$(this).parent().css("text-decoration","line-through")
$(this).parent().removeClass("r_snapshot");
$(this).next().remove();
$(this).remove();
return false;
});
-16
View File
@@ -1,16 +0,0 @@
/*
*
* Easy front-end framework
*
* Copyright (c) 2009 Alen Grakalic
* http://easyframework.com/license.php
*
* supported by Templatica (http://templatica.com)
* and Css Globe (http://cssglobe.com)
*
* built to be used with jQuery library
* http://jquery.com
*
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(8($){$.1Y={2S:8(3){6 g={j:\'#2T 2U\',1x:\'2V\'};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);s $(3.j).q(8(){$(4).1Z(8(){$(\'20:21\',4).15(Q);$(\'a:21\',4).1f(3.1x)},8(){$(\'20\',4).V();$(\'a\',4).1g(3.1x)})})},22:8(3){6 g={j:\'.22\',17:10,1y:25,23:1h,o:\'2W\',f:\'\',1z:\'\'};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);6 f;s $(3.j).q(8(){6 p=$(4).l(\'p\');$(4).1Z(8(e){f=(3.f!=\'\')?3.f:p;f=(3.1z!=\'\')?$(\'#\'+3.1z).24():f;$(4).l(\'p\',\'\');b(f!=\'\'&&f!=2X){$(\'W\').26(\'<I o="\'+3.o+\'">\'+f+\'</I>\');$(\'#\'+3.o).m({\'X\':\'18\',\'1A\':\'1B\'}).m(\'t\',(e.27-3.1y)+\'J\').m(\'y\',(e.1i+3.17)+\'J\').15(\'28\')}},8(){$(\'#\'+3.o).A();$(4).l(\'p\',p)});$(4).2Y(8(e){6 x=((e.1i+3.17+$(4).r())<$(K).r())?(e.1i+3.17):(e.1i-3.17-$(4).r()-16);$(\'#\'+3.o).m(\'t\',(e.27-3.1y)+\'J\').m(\'y\',(x+\'J\'))});b(3.23){$(4).2Z(8(e){$(\'#\'+3.o).A();$(4).l(\'p\',p)})}})},29:8(3){6 g={j:\'.29\',k:\'30\',2a:\'31...\',2b:\'32 33 34 a 35 36 37 38, 39 19 3a 4 K 3b 3c 3d.\',2c:\'3e\'};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);s $(3.j).q(8(){$(4).19(8(e){e.3f();b($.1a.2d)$.3g.2e=R;6 1j=$.1a.3h&&$.1a.2f.2g(0,1)<7;6 2h=$.1a.2d&&$.1a.2f<=9.5;6 w=$(K).r();6 h=$(2i).B();6 2j=$(K).r()/2;6 2k=$(K).B()/2;L=8(){$(\'#\'+3.k+\'1k\').A();b(Y!=0)$(\'#\'+3.k+\'f\').m(\'r\',Y+\'J\');b(Z!=0)$(\'#\'+3.k+\'f\').m(\'B\',Z+\'J\');1C($(\'#\'+3.k+\'f\'));$(\'11\',\'#\'+3.k+\'f\').m(\'1l\',\'1D\')};1C=8(c){$(c).m({\'3i\':\'3j\',\'2l\':\'#2m\',\'2n\':\'#3k\',\'u-3l\':\'y\',\'2o\':\'y\',\'X\':\'3m\',\'z-2p\':\'3n\',\'1D\':\'1m\'});6 y=2j-$(c).r()/2;6 t=2k-$(c).B()/2;$(c).m({\'y\':y,\'t\':t,\'1A\':\'1B\'}).15(\'1E\');b(1j)$(c).m({\'X\':\'18\',\'t\':(t+$(K).1F())+\'J\'});b(2h)$(c).m({\'X\':\'18\',\'t\':(2i.W[\'3o\']/2-$(c).B()/2+$(K).1F())+\'J\'})};b(1j)$(\'1n, 1o, 2q\').m(\'1l\',\'1m\');C=8(){$(\'#\'+3.k+\'f\').u(3.2b);L()};A=8(){$(\'#\'+3.k).A();$(\'#\'+3.k+\'f\').A();$(\'#\'+3.k+\'1k\').A();b(1j)$(\'1n, 1o, 2q\').m(\'1l\',\'1D\')};$(\'<I o="\'+3.k+\'"></I>\').M(\'W\').m({\'r\':w,\'B\':h,\'2l\':\'#3p\',\'X\':\'18\',\'t\':\'0\',\'y\':\'0\',\'z-2p\':\'3q\',\'2e\':.7}).19(8(){A()});6 n=$(4).l(\'n\');6 12=n.2g(n.3r(\'.\')).1G();6 f;6 Y=0;6 Z=0;6 1b=1h;$(\'<I o="\'+3.k+\'1k">\'+3.2a+\'</I>\').M(\'W\');1C($(\'#\'+3.k+\'1k\'));$(\'<I o="\'+3.k+\'f"></I>\').M(\'W\');b($(4).13(\'1p\')){6 1p=\'<1o r="Q%" B="Q%"><1H 1I="2r" 1J="R" /><1H 1I="2s" 1J="2t" /><1H 1I="3s" 1J="\'+n+\'" /><1n 1K="\'+n+\'" 1L="3t/x-3u-1p" 2r="R" 2s="2t" r="Q%" B="Q%"></1n></1o>\';$(1p).M(\'#\'+3.k+\'f\');Y=3v;Z=3w;1b=R}E{b(12==\'.3x\'||12==\'.3y\'||12==\'.3z\'||12==\'.3A\'||12==\'.3B\'){6 11=1M 3C();$(11).C(8(){C()}).m(\'1l\',\'1m\').M(\'#\'+3.k+\'f\');11.2u=8(){L();11.2u=8(){}};11.1K=n+\'?\'+(1M 2v()).2w()+\' =\'+(1M 2v()).2w()}E b(n.3D(0)==\'#\'){$(n).3E().1g(\'1m\').L().M(\'#\'+3.k+\'f\');$.1Y.2x(\'#\'+3.k+\'f 2y\');1b=R}E{$(\'<3F 3G="0" 3H="3I" 3J="r:Q%;B:Q%" 1K="\'+n+\'" />\').M(\'#\'+3.k+\'f\');Y=3K;Z=3L;1b=R}};6 T=$(4).l(\'T\').1N(\';\');$.q(T,8(i){b(T[i].1q(\'r\')!=-1)Y=T[i].1N(\':\')[1];b(T[i].1q(\'B\')!=-1)Z=T[i].1N(\':\')[1]});b(1b)L();$(\'<1O>\'+3.2c+\'</1O>\').M(\'#\'+3.k+\'f\').m({\'X\':\'18\',\'2o\':\'y\',\'y\':\'0\',\'t\':\'-3M\',\'2n\':\'#2m\',\'2z\':\'2A\'});$(\'#\'+3.k+\', #\'+3.k+\'f 1O\').19(8(){A()})})})},2B:8(3){6 g={j:\'a\'};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);6 1c=K.3N.1c;1c=1c.3O(\'3P.\',\'\').1G();s $(3.j).q(8(){6 n=$(4).l(\'n\').1G();b(n.1q(\'2C://\')!=-1&&n.1q(1c)==-1){$(4).l(\'v\',\'3Q\');$(4).1f(\'2B\')}})},2D:8(3){6 g={j:\'.2D\',2E:3R,2F:1h};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);s $(3.j).q(8(){6 c=$(4);6 1r=$(c).2G().1r;6 U=0;8 1P(){6 14=2H.3S(2H.3T()*1r)+1;s 14};8 L(){b(3.2F){6 14=1P();3U(14==U){14=1P()};U=14}E{U=(U==1r)?1:U+1};$(c).2G().V();$(\':3V-3W(\'+U+\')\',c).15(\'3X\')};L();3Y(L,3.2E)})},2I:8(3){6 g={j:\'a.2I\',3Z:1E};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);s $(3.j).19(8(){6 v=$($(4).l(\'n\'));6 1Q=$(v).1Q().t;$(\'24,W\').40({1F:1Q},1E,\'41\')})},42:8(3){6 g={j:\'.2J\'};b(F 3==\'G\')g.j=3;6 3=$.H(g,3);s $(3.j).q(8(){6 v;b($(4).13(\'2K\')){v=$(4).2K().V()}E b($(4).13(\'o\')){v=$(4).l(\'n\');v=$(v).V()}E{v=$(4).43().V()};$(4).m(\'2z\',\'2A\');$(4).2J(8(){$(4).1f(\'2L\');$(v).44()},8(){$(v).45();$(4).1g(\'2L\')})})},2x:8(3){6 g={j:\'2y\',N:\'46 1s O\',2M:\'47 1R 48 1s O\',2N:\'49 1s O\',2O:\'4a 4b 1s O\',1t:\'4c\'};8 1u(c){b($(c).D()==\'\'||1S(c)){6 P=($(c).l(\'p\')!=\'\')?$(c).l(\'p\'):3.N;C(c,P)}};8 1v(c,1L){6 1d,N;4d(1L){2P\'1T\':1d=/(4e|2C|4f):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/;N=3.2N;2Q;2P\'1U\':6 1d=/[\\d\\4g-]/;N=3.2O;2Q;4h:1d=/^[^@]+@[^@]+.[a-z]{2,}$/;N=3.2M};6 D=$(c).D();b(D.4i(1d)==-1||1S(c)){6 P=($(c).l(\'p\')!=\'\')?$(c).l(\'p\'):N;C(c,P)}};8 1S(c){6 u=$(\'1e[1V=\'+$(c).l(\'o\')+\']\').u();s(u==$(c).D())};8 C(c,P){6 1w=$(c).1w();1w.2Line truncated
-3
View File
@@ -1,3 +0,0 @@
$("#page_design_id").live('change', function() {
$.getScript($(this).attr('rel') + '/' + $(this).val() + '/reload_themes');
});
@@ -0,0 +1,26 @@
$(function () {
$('#panel_sidebar a, #panel_main a.nav').live('click',
function () {
$.getScript(this.href);
history.pushState(null, document.title, this.href);
return false;
}
);
$('#panel_main a.reload').live('click',
function () {
$.getScript(this.href);
history.replaceState(null, document.title, this.href);
return false;
}
);
$('.form').live('submit', function () {
$.post(this.action, $(this).serialize(), null, 'script');
return false;
});
$(window).bind("popstate", function () {
$.getScript(location.href);
});
});
+9
View File
@@ -0,0 +1,9 @@
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require side_bar_history