diff --git a/dist/js/app-old.js b/dist/js/app-old.js deleted file mode 100755 index 0d0f56a68..000000000 --- a/dist/js/app-old.js +++ /dev/null @@ -1,701 +0,0 @@ -/*! - * Author: Abdullah A Almsaeed - * Date: 4 Jan 2014 - * Description: - * This file should be included in all pages - *!*/ - -/* - * Global variables. If you change any of these vars, don't forget - * to change the values in the less files! - */ -var left_side_width = 230; //Sidebar width in pixels - -$(function () { - "use strict"; - - //Enable sidebar toggle - $("[data-toggle='offcanvas']").click(function (e) { - e.preventDefault(); - //Enable sidebar push menu - $("body").toggleClass('sidebar-collapse'); - $("body").toggleClass('sidebar-open'); - }); - - //Add hover support for touch devices - $('.btn').bind('touchstart', function () { - $(this).addClass('hover'); - }).bind('touchend', function () { - $(this).removeClass('hover'); - }); - - //Activate tooltips - $("[data-toggle='tooltip']").tooltip(); - - /* - * Add collapse and remove events to boxes - */ - $("[data-widget='collapse']").click(function () { - //Find the box parent - var box = $(this).parents(".box").first(); - //Find the body and the footer - var bf = box.find(".box-body, .box-footer"); - if (!box.hasClass("collapsed-box")) { - box.addClass("collapsed-box"); - //Convert minus into plus - $(this).children(".fa-minus").removeClass("fa-minus").addClass("fa-plus"); - bf.slideUp(); - } else { - box.removeClass("collapsed-box"); - //Convert plus into minus - $(this).children(".fa-plus").removeClass("fa-plus").addClass("fa-minus"); - bf.slideDown(); - } - }); - - /* - * ADD SLIMSCROLL TO THE TOP NAV DROPDOWNS - * --------------------------------------- - */ - $(".navbar .menu").slimscroll({ - height: "200px", - alwaysVisible: false, - size: "3px" - }).css("width", "100%"); - - /* - * INITIALIZE BUTTON TOGGLE - * ------------------------ - */ - $('.btn-group[data-toggle="btn-toggle"]').each(function () { - var group = $(this); - $(this).find(".btn").click(function (e) { - group.find(".btn.active").removeClass("active"); - $(this).addClass("active"); - e.preventDefault(); - }); - - }); - - $("[data-widget='remove']").click(function () { - //Find the box parent - var box = $(this).parents(".box").first(); - box.slideUp(); - }); - - /* Sidebar tree view */ - $(".sidebar .treeview").tree(); - - /* - * Make sure that the sidebar is streched full height - * --------------------------------------------- - * We are gonna assign a min-height value every time the - * wrapper gets resized and upon page load. We will use - * Ben Alman's method for detecting the resize event. - * - **/ - function _fix() { - //Get window height and the wrapper height - var neg = $('.main-header').height() - ($('.main-footer').height()); - var window_height = $(window).height() - var sidebar_height = $(".left-side").height(); - if (window_height >= sidebar_height) { - $(".content, .left-side").css('min-height', window_height - neg); - } else { - $(".content, .left-side").css('min-height', sidebar_height - neg); - } - } - //Fire upon load - _fix(); - //Fire when wrapper is resized - $(".wrapper").resize(function () { - _fix(); - fix_sidebar(); - }); - - //Fix the fixed layout sidebar scroll bug - fix_sidebar(); - - /* - * We are gonna initialize all checkbox and radio inputs to - * iCheck plugin in. - * You can find the documentation at http://fronteed.com/iCheck/ - */ - $("input[type='checkbox']:not(.simple), input[type='radio']:not(.simple)").iCheck({ - checkboxClass: 'icheckbox_minimal', - radioClass: 'iradio_minimal' - }); - -}); -function fix_sidebar() { - //Make sure the body tag has the .fixed class - if (!$("body").hasClass("fixed")) { - return; - } - - //Add slimscroll - $(".sidebar").slimscroll({ - height: ($(window).height() - $(".header").height()) + "px", - color: "rgba(0,0,0,0.2)" - }); -} - -/*END DEMO*/ - -/* - * BOX REFRESH BUTTON - * ------------------ - * This is a custom plugin to use with the compenet BOX. It allows you to add - * a refresh button to the box. It converts the box's state to a loading state. - * - * USAGE: - * $("#box-widget").boxRefresh( options ); - * */ -(function ($) { - "use strict"; - - $.fn.boxRefresh = function (options) { - - // Render options - var settings = $.extend({ - //Refressh button selector - trigger: ".refresh-btn", - //File source to be loaded (e.g: ajax/src.php) - source: "", - //Callbacks - onLoadStart: function (box) { - }, //Right after the button has been clicked - onLoadDone: function (box) { - } //When the source has been loaded - - }, options); - - //The overlay - var overlay = $('
'); - - return this.each(function () { - //if a source is specified - if (settings.source === "") { - if (console) { - console.log("Please specify a source first - boxRefresh()"); - } - return; - } - //the box - var box = $(this); - //the button - var rBtn = box.find(settings.trigger).first(); - - //On trigger click - rBtn.click(function (e) { - e.preventDefault(); - //Add loading overlay - start(box); - - //Perform ajax call - box.find(".box-body").load(settings.source, function () { - done(box); - }); - - - }); - - }); - - function start(box) { - //Add overlay and loading img - box.append(overlay); - - settings.onLoadStart.call(box); - } - - function done(box) { - //Remove overlay and loading img - box.find(overlay).remove(); - - settings.onLoadDone.call(box); - } - - }; - -})(jQuery); - -/* - * SIDEBAR MENU - * ------------ - * This is a custom plugin for the sidebar menu. It provides a tree view. - * - * Usage: - * $(".sidebar).tree(); - * - * Note: This plugin does not accept any options. Instead, it only requires a class - * added to the element that contains a sub-menu. - * - * When used with the sidebar, for example, it would look something like this: - *