Skip to content
Browse files

switching dashboard into a separate .js file

  • Loading branch information...
1 parent 58d614b commit 9ac3ade25a30dd224b6a1f70410aa2b4c4e01570 @aembler aembler committed Feb 14, 2013
View
5 build/js.sh
@@ -9,14 +9,17 @@ rm bootstrap.tmp.js
uglifyjs --no-copyright -o ../web/concrete/js/jquery.cookie.js ../web/concrete/js/ccm_app/jquery.cookie.js
+cat ../web/concrete/js/ccm_app/dashboard.js > ccm.dashboard.tmp.js
+uglifyjs --no-copyright --no-seqs -o ../web/concrete/js/ccm.dashboard.js ./ccm.dashboard.tmp.js
+rm ccm.dashboard.tmp.js
+
# Note: The order here is important
cat ../web/concrete/js/ccm_app/jquery.colorpicker.js \
../web/concrete/js/ccm_app/jquery.hoverIntent.js \
../web/concrete/js/ccm_app/jquery.liveupdate.js \
../web/concrete/js/ccm_app/jquery.metadata.js \
../web/concrete/js/ccm_app/chosen.jquery.js \
-../web/concrete/js/ccm_app/dashboard.js \
../web/concrete/js/ccm_app/filemanager.js \
../web/concrete/js/ccm_app/jquery.cookie.js \
../web/concrete/js/ccm_app/layouts.js \
View
8 web/concrete/js/ccm.app.js
4 additions, 4 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1 web/concrete/js/ccm.dashboard.js
@@ -0,0 +1 @@
+ccm_closeDashboardPane=function(e){$(e).closest("div.ccm-pane").fadeOut(120,"easeOutExpo")};ccm_getDashboardBackgroundImageData=function(e,t){$.getJSON(CCM_TOOLS_PATH+"/dashboard/get_image_data",{image:e},function(e){if(e&&t){var n="<div>";n+="<strong>"+e.title+"</strong> "+ccmi18n.authoredBy+" ";e.link?n+='<a target="_blank" href="'+e.link+'">'+e.author+"</a>":n+=e.author;$('<div id="ccm-dashboard-image-caption" class="ccm-ui"/>').html(n).appendTo(document.body).show();setTimeout(function(){$("#ccm-dashboard-image-caption").fadeOut(1e3,"easeOutExpo")},5e3)}})};var lastSizeCheck=9999999;ccm_testFixForms=function(){$(window).width()<=560&&lastSizeCheck>560?ccm_fixForms():$(window).width()>560&&lastSizeCheck<=560&&ccm_fixForms(!0);lastSizeCheck=$(window).width()};ccm_fixForms=function(e){$("form").each(function(){var t=$(this);e?t.attr("original-class")=="form-horizontal"&&t.attr("class","").addClass("form-horizontal"):t.removeClass("form-horizontal")})};ccm_dashboardEqualizeMenus=function(){if($(window).width()<560){$("div.dashboard-icon-list div.well").css("visibility","visible");return!1}var e=-1,t,n=0,r=new Array;$("ul.nav-list").each(function(){if($(this).position().top!=n){e++;r[e]=new Array}r[e].push($(this));n=$(this).position().top});for(t=0;t<r.length;t++){var i=0;for(e=0;e<r[t].length;e++){var s=r[t][e];s.height()>i&&(i=s.height())}for(e=0;e<r[t].length;e++){var s=r[t][e];s.css("height",i)}}$("div.dashboard-icon-list div.well").css("visibility","visible")};$(function(){ccm_activateToolbar();var e=$("#ccm-page-help").popover({trigger:"click",content:function(){var e=$(this).attr("id")+"-content";return $("#"+e).html()},placement:"bottom",html:!0}).click(function(e){e.stopPropagation()});$(document).click(function(){e.data("popover").hide()});$(".launch-tooltip").tooltip({placement:"bottom"});if($("#ccm-dashboard-result-message").length>0){if($(".ccm-pane").length>0){var t=$(".ccm-pane").parent().attr("class"),n=$(".ccm-pane").parent().parent().attr("class"),r=$("#ccm-dashboard-result-message").html();$("#ccm-dashboard-result-message").html('<div class="'+n+'"><div class="'+t+'">'+r+"</div></div>").fadeIn(400)}}else $("#ccm-dashboard-result-message").fadeIn(200)});
View
22 web/concrete/js/ccm_app/dashboard.js
@@ -22,6 +22,28 @@ ccm_getDashboardBackgroundImageData = function(image, display) {
});
}
+var lastSizeCheck = 9999999;
+ccm_testFixForms = function() {
+ if ($(window).width() <= 560 && lastSizeCheck > 560) {
+ ccm_fixForms();
+ } else if ($(window).width() > 560 && lastSizeCheck <= 560) {
+ ccm_fixForms(true);
+ }
+ lastSizeCheck = $(window).width();
+}
+ccm_fixForms = function(horizontal) {
+ $('form').each(function() {
+ var f = $(this);
+ if (horizontal) {
+ if (f.attr('original-class') == 'form-horizontal') {
+ f.attr('class', '').addClass('form-horizontal');
+ }
+ } else {
+ f.removeClass('form-horizontal');
+ }
+ });
+}
+
ccm_dashboardEqualizeMenus = function() {
if ($(window).width() < 560) {
$('div.dashboard-icon-list div.well').css('visibility', 'visible');
View
22 web/concrete/themes/dashboard/elements/header.php
@@ -43,6 +43,7 @@
$v->addFooterItem('<script type="text/javascript" src="' . REL_DIR_FILES_TOOLS_REQUIRED . '/i18n_js"></script>');
$v->addFooterItem($html->javascript('bootstrap.js'));
$v->addFooterItem($html->javascript('ccm.app.js'));
+$v->addFooterItem($html->javascript('ccm.dashboard.js'));
$v->addFooterItem(Loader::helper('html')->javascript('tiny_mce/tiny_mce.js'));
if (ENABLE_PROGRESSIVE_PAGE_REINDEX && Config::get('DO_PAGE_REINDEX_CHECK')) {
@@ -72,27 +73,6 @@
$backgroundImage = Loader::helper('concrete/dashboard')->getDashboardBackgroundImage();
?>
<script type="text/javascript">
- var lastSizeCheck = 9999999;
- ccm_testFixForms = function() {
- if ($(window).width() <= 560 && lastSizeCheck > 560) {
- ccm_fixForms();
- } else if ($(window).width() > 560 && lastSizeCheck <= 560) {
- ccm_fixForms(true);
- }
- lastSizeCheck = $(window).width();
- }
- ccm_fixForms = function(horizontal) {
- $('form').each(function() {
- var f = $(this);
- if (horizontal) {
- if (f.attr('original-class') == 'form-horizontal') {
- f.attr('class', '').addClass('form-horizontal');
- }
- } else {
- f.removeClass('form-horizontal');
- }
- });
- }
$(function() {
<? if ($backgroundImage->image) { ?>

0 comments on commit 9ac3ade

Please sign in to comment.
Something went wrong with that request. Please try again.