Ray's changes for css and js

This commit is contained in:
chris committed 2013-07-22 16:31:44 +08:00
1 parent 408bebaa4b
commit fe82427baa
306 files changed
+20659 -607

No files matched your search

+15 -14
View File
@@ -1,27 +1,28 @@
$(function () {
var $fileList = $('.file-list'),
$fileType = $('.file-type');
$type = ['pdf', 'psd', 'ai', 'fla', 'swf', 'in', 'acc', 'do', 'xl', 'pp', 'zip', 'rar', '7z', 'txt', 'jp', 'gif', 'png', 'mp3', 'wav']
$fileType = $('.file-type'),
$type = ['pdf', 'psd', 'ai', 'fla', 'swf', 'in', 'acc', 'do', 'xl', 'pp', 'zip', 'rar', '7z', 'txt', 'jp', 'gif', 'png', 'mp3', 'wav'];
$fileType.each(function (i) {
var $fileTypeHref = $(this).children('a').attr('href');
$fileTypeHref = $fileTypeHref.split("/");
$fileTypeHref = $fileTypeHref[$fileTypeHref.length-1];
$fileTypeHref = $fileTypeHref.split(".");
$fileTypeHref = $fileTypeHref[$fileTypeHref.length-1];
for(var j = 0; j<$type.length; j++) {
if($fileTypeHref.indexOf($type[j])!=-1) {
if($type[j] == "swf") {
$fileTypeHref = $fileTypeHref.split("/");
$fileTypeHref = $fileTypeHref[$fileTypeHref.length-1];
$fileTypeHref = $fileTypeHref.split(".");
$fileTypeHref = $fileTypeHref[$fileTypeHref.length-1];
$.map($type, function(type, index) {
if($fileTypeHref.indexOf(type)!=-1) {
if(type == "swf") {
$fileType.eq(i).addClass('type-fla');
} else if($type[j] == "zip" || $type[j] == "rar" || $type[j] == "7z") {
} else if(type == "zip" || type == "rar" || type == "7z") {
$fileType.eq(i).addClass('type-zip');
} else if($type[j] == "mp3" || $type[j] == "wav") {
} else if(type == "mp3" || type == "wav") {
$fileType.eq(i).addClass('type-audio');
} else {
$fileType.eq(i).addClass('type-'+$type[j]);
$fileType.eq(i).addClass('type-'+type);
}
}
}
})
});
});
+176 -47
View File
@@ -70,7 +70,7 @@
icon.removeClass(this.timeIcon);
icon.addClass(this.dateIcon);
}
this.widget = $(getTemplate(this.timeIcon, options.pickDate, options.pickTime, options.pick12HourFormat)).appendTo('body');
this.widget = $(getTemplate(this.format, this.timeIcon, options.pickDate, options.pickTime, options.pick12HourFormat)).appendTo('body');
this.minViewMode = options.minViewMode||this.$element.data('date-minviewmode')||0;
if (typeof this.minViewMode === 'string') {
switch (this.minViewMode) {
@@ -113,6 +113,7 @@
},
show: function(e) {
if(!e.currentTarget.value) this.setValue(new Date());
this.widget.show();
this.height = this.component ? this.component.outerHeight() : this.$element.outerHeight();
this.width = this.component ? this.component.outerWidth() : this.$element.outerWidth();
@@ -442,8 +443,18 @@
case 'prev':
case 'next':
var vd = this.viewDate;
var navFnc = DPGlobal.modes[this.viewMode].navFnc;
var step = DPGlobal.modes[this.viewMode].navStep;
var navFnc;
var step;
if(this.format == 'yyyy') {
navFnc = YGlobal.modes[this.viewMode].navFnc
step = YGlobal.modes[this.viewMode].navStep
} else if(this.format == 'yyyy/MM') {
navFnc = YMGlobal.modes[this.viewMode].navFnc
step = YMGlobal.modes[this.viewMode].navStep
} else {
navFnc = DPGlobal.modes[this.viewMode].navFnc
step = DPGlobal.modes[this.viewMode].navStep
};
if (target[0].className === 'prev') step = step * -1;
vd['set' + navFnc](vd['get' + navFnc]() + step);
this.fillDate();
@@ -459,18 +470,18 @@
var year = parseInt(target.text(), 10) || 0;
this.viewDate.setUTCFullYear(year);
}
if (this.viewMode !== 0) {
this._date = UTCDate(
this.viewDate.getUTCFullYear(),
this.viewDate.getUTCMonth(),
this.viewDate.getUTCDate(),
this._date.getUTCHours(),
this._date.getUTCMinutes(),
this._date.getUTCSeconds(),
this._date.getUTCMilliseconds()
);
this.notifyChange();
}
// if (this.viewMode !== 0) {
this._date = UTCDate(
this.viewDate.getUTCFullYear(),
this.viewDate.getUTCMonth(),
this.viewDate.getUTCDate(),
this._date.getUTCHours(),
this._date.getUTCMinutes(),
this._date.getUTCSeconds(),
this._date.getUTCMilliseconds()
);
this.notifyChange();
// }
this.showMode(-1);
this.fillDate();
this.set();
@@ -507,7 +518,7 @@
this.fillDate();
this.set();
this.notifyChange();
this.widget.hide();
// this.widget.hide();
}
break;
}
@@ -703,11 +714,23 @@
showMode: function(dir) {
if (dir) {
this.viewMode = Math.max(this.minViewMode, Math.min(
2, this.viewMode + dir));
if(this.format == 'yyyy') {
this.viewMode = Math.max(this.minViewMode, Math.min(0, this.viewMode + dir));
} else if(this.format == 'yyyy/MM') {
this.viewMode = Math.max(this.minViewMode, Math.min(1, this.viewMode + dir));
} else {
this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir));
}
}
this.widget.find('.datepicker > div').hide().filter(
'.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
var clsName = null;
if(this.format == 'yyyy') {
clsName = '.datepicker-'+YGlobal.modes[this.viewMode].clsName
} else if(this.format == 'yyyy/MM') {
clsName = '.datepicker-'+YMGlobal.modes[this.viewMode].clsName
} else {
clsName = '.datepicker-'+DPGlobal.modes[this.viewMode].clsName
};
this.widget.find('.datepicker > div').hide().filter(clsName).show();
},
destroy: function() {
@@ -832,6 +855,16 @@
'^\\s*' + components.join('') + '\\s*$');
this._propertiesByIndex = propertiesByIndex;
},
_getInternetExplorerVersion: function(){
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer'){
var ua = navigator.userAgent;
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat( RegExp.$1 );
}
return rv;
},
_attachDatePickerEvents: function() {
var self = this;
@@ -872,11 +905,18 @@
});
}
} else {
this.$element.on({
'focus': $.proxy(this.show, this),
'blur': $.proxy(this.hide, this),
'change': $.proxy(this.change, this),
}, 'input');
if(this._getInternetExplorerVersion() == -1){
this.$element.on({
'focus': $.proxy(this.show, this),
'blur': $.proxy(this.hide, this),
'change': $.proxy(this.change, this),
}, 'input');
}else{
this.$element.on({
'blur': $.proxy(this.hide, this),
'change': $.proxy(this.change, this),
}, 'input');
}
if (this.options.maskInput) {
this.$element.on({
'keydown': $.proxy(this.keydown, this),
@@ -1010,7 +1050,7 @@
else return Array(l - s.length + 1).join(c || ' ') + s;
}
function getTemplate(timeIcon, pickDate, pickTime, is12Hours) {
function getTemplate(format, timeIcon, pickDate, pickTime, is12Hours) {
if (pickDate && pickTime) {
return (
'<div class="bootstrap-datetimepicker-widget dropdown-menu">' +
@@ -1038,13 +1078,31 @@
'</div>'
);
} else {
return (
'<div class="bootstrap-datetimepicker-widget dropdown-menu">' +
'<div class="datepicker">' +
DPGlobal.template +
'</div>' +
'</div>'
);
if(format == 'yyyy') {
return(
'<div class="bootstrap-datetimepicker-widget dropdown-menu">' +
'<div class="datepicker">' +
YGlobal.template +
'</div>' +
'</div>'
)
} else if(format == 'yyyy/MM') {
return (
'<div class="bootstrap-datetimepicker-widget dropdown-menu">' +
'<div class="datepicker">' +
YMGlobal.template +
'</div>' +
'</div>'
);
} else {
return (
'<div class="bootstrap-datetimepicker-widget dropdown-menu">' +
'<div class="datepicker">' +
DPGlobal.template +
'</div>' +
'</div>'
);
}
}
}
@@ -1055,20 +1113,21 @@
var DPGlobal = {
modes: [
{
clsName: 'days',
navFnc: 'UTCMonth',
navStep: 1
},
{
clsName: 'months',
navFnc: 'UTCFullYear',
navStep: 1
},
{
clsName: 'years',
navFnc: 'UTCFullYear',
navStep: 10
}],
clsName: 'days',
navFnc: 'UTCMonth',
navStep: 1
},
{
clsName: 'months',
navFnc: 'UTCFullYear',
navStep: 1
},
{
clsName: 'years',
navFnc: 'UTCFullYear',
navStep: 10
}
],
isLeapYear: function (year) {
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
},
@@ -1085,6 +1144,56 @@
'</thead>',
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>'
};
var YMGlobal = {
modes: [
{
clsName: 'months',
navFnc: 'UTCFullYear',
navStep: 1
},
{
clsName: 'years',
navFnc: 'UTCFullYear',
navStep: 10
}
],
isLeapYear: function (year) {
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
},
getDaysInMonth: function (year, month) {
return [31, (YMGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
},
headTemplate:
'<thead>' +
'<tr>' +
'<th class="prev">&lsaquo;</th>' +
'<th colspan="5" class="switch"></th>' +
'<th class="next">&rsaquo;</th>' +
'</tr>' +
'</thead>',
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>'
};
var YGlobal = {
modes: [
{
clsName: 'years',
navFnc: 'UTCFullYear',
navStep: 10
}
],
isLeapYear: function (year) {
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
},
headTemplate:
'<thead>' +
'<tr>' +
'<th class="prev">&lsaquo;</th>' +
'<th colspan="5" class="switch"></th>' +
'<th class="next">&rsaquo;</th>' +
'</tr>' +
'</thead>',
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>'
};
DPGlobal.template =
'<div class="datepicker-days">' +
'<table class="table-condensed">' +
@@ -1104,6 +1213,26 @@
DPGlobal.contTemplate+
'</table>'+
'</div>';
YMGlobal.template =
'<div class="datepicker-months">' +
'<table class="table-condensed">' +
DPGlobal.headTemplate +
DPGlobal.contTemplate+
'</table>'+
'</div>'+
'<div class="datepicker-years">'+
'<table class="table-condensed">'+
DPGlobal.headTemplate+
DPGlobal.contTemplate+
'</table>'+
'</div>';
YGlobal.template =
'<div class="datepicker-years">'+
'<table class="table-condensed">'+
DPGlobal.headTemplate+
DPGlobal.contTemplate+
'</table>'+
'</div>';
var TPGlobal = {
hourTemplate: '<span data-action="showHours" data-time-component="hours" class="timepicker-hour"></span>',
minuteTemplate: '<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"></span>',
+2 -4
View File
@@ -26,7 +26,7 @@
!function ($) {
$.fn.cardCheck = function(param) {
_defaultSettings = {
item: '',
item: '.check-item',
};
_set = $.extend(_defaultSettings, param);
$main = $(this);
@@ -58,8 +58,6 @@ $(function(){
item: '.card',
});
} else {
$('#card-list').cardCheck({
item: '.filter-item',
});
$('.checkbox-card').cardCheck();
};
});
+4 -1
View File
@@ -367,10 +367,13 @@
$row.removeClass('footable-detail-show');
//only hide the next row if it's a detail row
if($next.hasClass('footable-row-detail'))
$next.hide();
$next.find('.footable-row-detail-inner').slideUp(300, function() {
$next.hide();
});
} else {
$row.addClass('footable-detail-show');
$next.show();
$next.find('.footable-row-detail-inner').slideDown(300);
}
};
+62 -31
View File
@@ -37,7 +37,6 @@
// Load a URL. Into an iframe?
if( useIframe ) {
var iframe = $("<iframe />").attr({
id: "page_iframe",
src: url,
frameborder: 0,
hspace: 0
@@ -53,13 +52,6 @@
} else {
$viewPage.find('.content').load(url, function(){
$viewPage.clone(true).appendTo( $pageslide.empty() ).show();
if($('#filter-default-tag').length) {
$('#filter-default-tag').fastLiveFilter('.add-default-tags-list', '.filter-item', '.tag');
addTagsTab();
$('#view-page .card').cardCheck({
check: $('#view-page input[type="checkbox"]'),
});
};
});
}
@@ -91,7 +83,7 @@
$pageslide.css({ left: '-' + (slideWidth-61) + 'px', right: 'auto' });
};
bodyAnimateIn['margin-left'] = '+=' + slideWidth;
if($(window).width() < 1440 && slideWidth > 963 ) {
if($(window).width() <= 1440 && slideWidth > 963 ) {
bodyAnimateIn['width'] = $body.width();
}
slideAnimateIn['left'] = '+=' + slideWidth;
@@ -100,11 +92,14 @@
// Animate the slide, and attach this slide's settings to the element
$body.animate(bodyAnimateIn, speed);
$pageslide.show()
.animate(slideAnimateIn, speed, function() {
_sliding = false;
$pageslide.children('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
});
$pageslide.show().animate(slideAnimateIn, speed, function() {
_sliding = false;
$pageslide.children('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
if(typeof $.fn.pageslide.defaults.openFn === "function") {
var returnValue = ($.fn.pageslide.defaults.iframe ? $viewPage : $pageslide);
$.fn.pageslide.defaults.openFn.call(this,returnValue);
};
});
}
/*
@@ -112,19 +107,18 @@
*/
$.fn.pageslide = function(options) {
var $elements = this;
// On click
$elements.on(clickEvent, function(e) {
var $self = $(this),
settings = $.extend({ href: $self.attr('href') }, options);
// Prevent the default behavior and stop propagation
e.preventDefault();
e.stopPropagation();
if ( $pageslide.is(':visible') && $self[0] == _lastCaller ) {
// If we clicked the same element twice, toggle closed
// $.pageslide.close();
$.pageslide.close();
} else {
// Open
$.pageslide( settings );
@@ -142,6 +136,7 @@
});
}
}
$pageName = $self.parents('.item-title').children('a').text();
$('.page-name').text($pageName);
} else if($('.tags-groups').length) {
@@ -153,7 +148,8 @@
setTimeout(setScroll, 300);
// Record the last element to trigger pageslide
_lastCaller = $self[0];
}
};
});
};
@@ -166,7 +162,9 @@
modal: false, // If set to true, you must explicitly close pageslide using $.pageslide.close();
iframe: false, // By default, linked pages are loaded into an iframe. Set this to false if you don't want an iframe.
href: null, // Override the source of the content. Optional in most cases, but required when opening pageslide programmatically.
W: 264
W: 264,
closeFn : null,
openFn : null
};
/*
@@ -177,6 +175,21 @@
$.pageslide = function( options ) {
// Extend the settings with those the user has provided
var settings = $.extend({}, $.fn.pageslide.defaults, options);
var convertToFunction = function(fn){
var x = new Function();
x = fn;
return x;
}
// Change Object to Function
if(settings.openFn) {
$.fn.pageslide.defaults.openFn = convertToFunction(settings.openFn);
};
if(settings.closeFn) {
$.fn.pageslide.defaults.closeFn = convertToFunction(settings.closeFn);
}
// Are we trying to open in different direction?
if( ($pageslide.is(':visible') && $pageslide.data( 'W' ) != settings.W) || ($pageslide.is(':visible') && $pageslide.data( 'direction' ) != settings.direction) ) {
@@ -197,14 +210,16 @@
// if($('#add-tags').length) {
// $('.set_new').addClass('active in').siblings().removeClass('active in');
// $('#pageslide .select_default .search-query').attr('id','filter-default-tag')
// $('#filter-default-tag').fastLiveFilter('.add-default-tags-list', '.filter-item', '.tag');
// $('.add-default-tags-list .filter-item').removeClass('mark');
// }
}
if($('#add-tags').length) {
$('.set_new').addClass('active in').siblings().removeClass('active in');
$('#pageslide .selete_defat .search-query').attr('id','filter-default-tag');
$('#filter-default-tag').fastLiveFilter('.add-defalt-tags-list', '.filter-item', '.tag');
$('.add-defalt-tags-list .filter-item').removeClass('mark');
};
};
// Close the pageslide
$.pageslide.close = function( callback ) {
var $pageslide = $('#pageslide'),
@@ -252,10 +267,26 @@
_sliding = false;
if( typeof callback != 'undefined' ) callback();
$body.css({'width': 'auto'});
$('#view-page .content').empty();
$('#view-page .pane').remove();
});
if(typeof $.fn.pageslide.defaults.closeFn === "function") {
var returnValue = ($.fn.pageslide.defaults.iframe ? $viewPage : $pageslide);
$.fn.pageslide.defaults.closeFn.call(this,returnValue);
};
});
}
// Close Callback
$.pageslide.closeCallback = function(callback) {
if(typeof callback === "function"){
$.fn.pageslide.defaults.closeFn = callback;
};
};
// Open Callback
$.pageslide.openCallback = function(callback) {
if(typeof callback === "function"){
$.fn.pageslide.defaults.openFn = callback;
};
};
/* Events */
@@ -270,7 +301,7 @@
if( e.type == "keyup" && e.keyCode != 27) return;
// Make sure it's visible, and we're not modal
if( $pageslide.is( ':visible' ) && !$pageslide.data( 'modal' ) ) {
if( $pageslide.is( ':visible' ) && !$pageslide.data( 'modal' ) ) {
$.pageslide.close();
}
});
+9
View File
@@ -0,0 +1,9 @@
/*!
* Masonry PACKAGED v3.0.1
* Cascading grid layout library
* http://masonry.desandro.com
* MIT License
* by David DeSandro
*/
(function(t){"use strict";function e(t){if(t){if("string"==typeof n[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,o=0,r=i.length;r>o;o++)if(e=i[o]+t,"string"==typeof n[e])return e}}var i="Webkit Moz ms Ms O".split(" "),n=document.documentElement.style;"function"==typeof define&&define.amd?define(function(){return e}):t.getStyleProperty=e})(window),function(t){"use strict";function e(t){var e=parseFloat(t),i=-1===t.indexOf("%")&&!isNaN(e);return i&&e}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=s.length;i>e;e++){var n=s[e];t[n]=0}return t}function n(t){function n(t){if("string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var n=r(t);if("none"===n.display)return i();var h={};h.width=t.offsetWidth,h.height=t.offsetHeight;for(var p=h.isBorderBox=!(!a||!n[a]||"border-box"!==n[a]),u=0,f=s.length;f>u;u++){var d=s[u],c=n[d],l=parseFloat(c);h[d]=isNaN(l)?0:l}var m=h.paddingLeft+h.paddingRight,y=h.paddingTop+h.paddingBottom,g=h.marginLeft+h.marginRight,v=h.marginTop+h.marginBottom,_=h.borderLeftWidth+h.borderRightWidth,b=h.borderTopWidth+h.borderBottomWidth,L=p&&o,E=e(n.width);E!==!1&&(h.width=E+(L?0:m+_));var I=e(n.height);return I!==!1&&(h.height=I+(L?0:y+b)),h.innerWidth=h.width-(m+_),h.innerHeight=h.height-(y+b),h.outerWidth=h.width+g,h.outerHeight=h.height+v,h}}var o,a=t("boxSizing");return function(){if(a){var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style[a]="border-box";var i=document.body||document.documentElement;i.appendChild(t);var n=r(t);o=200===e(n.width),i.removeChild(t)}}(),n}var o=document.defaultView,r=o&&o.getComputedStyle?function(t){return o.getComputedStyle(t,null)}:function(t){return t.currentStyle},s=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define(["get-style-property"],n):t.getSize=n(t.getStyleProperty)}(window),function(t){"use strict";var e=document.documentElement,i=function(){};e.addEventListener?i=function(t,e,i){t.addEventListener(e,i,!1)}:e.attachEvent&&(i=function(e,i,n){e[i+n]=n.handleEvent?function(){var e=t.event;e.target=e.target||e.srcElement,n.handleEvent.call(n,e)}:function(){var i=t.event;i.target=i.target||i.srcElement,n.call(e,i)},e.attachEvent("on"+i,e[i+n])});var n=function(){};e.removeEventListener?n=function(t,e,i){t.removeEventListener(e,i,!1)}:e.detachEvent&&(n=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(n){t[e+i]=void 0}});var o={bind:i,unbind:n};"function"==typeof define&&define.amd?define(o):t.eventie=o}(this),function(t){"use strict";function e(t){"function"==typeof t&&(e.isReady?t():r.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==o.readyState;if(!e.isReady&&!i){e.isReady=!0;for(var n=0,s=r.length;s>n;n++){var a=r[n];a()}}}function n(n){return n.bind(o,"DOMContentLoaded",i),n.bind(o,"readystatechange",i),n.bind(t,"load",i),e}var o=t.document,r=[];e.isReady=!1,"function"==typeof define&&define.amd?define(["eventie"],n):t.docReady=n(t.eventie)}(this),function(t){"use strict";function e(){}function i(t,e){if(o)return e.indexOf(t);for(var i=e.length;i--;)if(e[i]===t)return i;return-1}var n=e.prototype,o=Array.prototype.indexOf?!0:!1;n._getEvents=function(){return this._events||(this._events={})},n.getListeners=function(t){var e,i,n=this._getEvents();if("object"==typeof t){e={};for(i in n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i])}else e=n[t]||(n[t]=[]);return e},n.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},n.addListener=function(t,e){var n,o=this.getListenersAsObject(t);for(n in o)o.hasOwnProperty(n)&&-1===i(e,o[n])&&o[n].push(e);return this},n.on=n.addListener,n.defineEvent=function(t){return this.getListeners(t),this},n.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},n.removeListener=function(t,e){var n,o,r=this.getListenersAsObject(t);for(o in r)r.hasOwnProperty(o)&&(n=i(e,r[o]),-1!==n&&r[o].splice(n,1));return this},n.off=n.removeListener,n.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},n.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},n.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},n.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"===i)delete n[t];else if("object"===i)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},n.emitEvenLine truncated
@@ -0,0 +1,37 @@
function loadViewPage(url, id) {
var $listView = $(id);
$listView.empty().removeClass('in active');
$listView.load(url, function(response, status, xhr) {
$(this).addClass('in active');
$('#member-card').imagesLoaded(function() {
$('#member-card .member-avatar img').muImageResize({width: 150, height:150});
});
$('#member-abstract').imagesLoaded(function() {
$('#member-abstract .member-avatar img').muImageResize({width: 250, height:120});
});
})
}
$(function() {
$search = window.location.pathname.substring(1);
$search = $search.split("/");
$search = $search[$search.length-1];
$viewType = window.localStorage.getItem('viewType') || '#member-list';
$viewSwitchNo = window.localStorage.getItem('viewSwitchNo') || 0;
if($search == 'users-registrant-list.shtml') {
loadViewPage('member-registrant-list.html ' + $viewType, '#list-view');
} else {
loadViewPage('member-list.html ' + $viewType, '#list-view');
};
$('.view-switch').children('.btn').eq($viewSwitchNo).addClass('active');
$('.view-switch').delegate(".btn", 'click', function(e){
var url = $(this).attr('href'),
ID = url.split("#"),
ID = '#' + ID[ID.length-1];
window.localStorage.setItem('viewType', ID);
window.localStorage.setItem('viewSwitchNo', $(this).index());
loadViewPage(url, '#list-view');
e.preventDefault();
});
})
@@ -0,0 +1,55 @@
// Go to
!function ($) {
$.fn.goTo = function (){
var $this = this,
$destination = $this.attr('href'),
$offset = $($destination).offset();
$this.on(clickEvent, function() {
$("html, body").animate({
scrollTop: $offset.top,
}, 500);
return false;
});
}
}(window.jQuery);
function checkHeight() {
if($('#member-module').height() > $(window).height()) {
H = $(window).height()-
parseInt($('.wrap-inner').css('padding-top'))+
parseInt($('.wrap-inner').css('padding-bottom'))-
$('#orbit-bar').outerHeight(true);
}else{
H = $(window).height()-
parseInt($('.wrap-inner').css('padding-top'))+
parseInt($('.wrap-inner').css('padding-bottom'))-
$('#filter').outerHeight()+
parseInt($('#filter').css('margin-bottom'))-
$('#orbit-bar').outerHeight(true);
};
$('#basic-info').height(H);
$('#member-roles').height(H-$('.member-avatar').outerHeight(true)-parseInt($('#member-roles').css('margin-top')))
};
$(function() {
var H;
checkHeight();
$(window).resize(function() {
checkHeight();
setModuleBlockWidth();
});
$('#member-roles h4 > span').each(function() {
$(this).css('margin-left',function() {
return $(this).innerWidth()/2*-1;
})
})
$('#basic-info').scrollToFixed({
marginTop: $('#orbit-bar').outerHeight(true)+20,
});
$('#module-navbar').scrollToFixed({
marginTop: $('#orbit-bar').outerHeight(true),
});
$('.member-avatar').imagesLoaded(function() {
$('#basic-info .member-avatar img').muImageResize({width: 100, height:100});
});
$('#member-roles').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
})
@@ -0,0 +1,475 @@
// Retrieve the initial data
function temporary() {
attributesArray.length = 0;
$('.attributes').each(function() {
var attributesData = {},
$selectType = $('.dataType').data().type;
// Capture "attributes-body" within the input[type = "text"] val
$(this).find('.attributes-body').find('input[type="text"]').each(function(i) {
var $type = $(this).data().type;
attributesData[$type] = $(this).val();
});
// Capture "attributes-body" within the input[type = "radio"] checked
$(this).find('.attributes-body').find('input[type="radio"]').each(function(i) {
var $type = $(this).data().type;
attributesData[$type] = $(this).prop("checked");
});
// Capture "attributes-body" within the dataType selected
$(this).find('.attributes-body').find('.dataType').children("option:selected").each(function () {
attributesData[$selectType] = {};
attributesData[$selectType].index = $(this).index();
attributesData[$selectType].name = $(this).attr('ref');
if($(this).attr('ref') == 'typeB' || $(this).attr('ref') == 'typeE' || $(this).attr('ref') == 'typeF') {
attributesData[$selectType].option = [];
}
});
// Capture "field-type" within the input[type = "text"] val
$(this).find('.field-type').find('input[type="text"]').each(function(i) {
var $type = $(this).data().type;
if(!$type.match('option_lang')) {
attributesData[$selectType][$type] = $(this).val();
}
});
$(this).find('.field-type .add-target').find('.input-append').each(function() {
var append = []
$(this).children('input[type="text"]').each(function() {
var val = $(this).val();
append.push(val);
});
attributesData[$selectType].option.push(append);
})
// Capture "field-type" within the input[type = "checkbox"] checked
$(this).find('.field-type').find('input[type="checkbox"]').each(function() {
var $type = $(this).data().type;
attributesData[$selectType][$type] = $(this).prop("checked");
});
// Capture "field-type" within the input[type = "radio"] checked
$(this).find('.field-type').find('input[type="radio"]').each(function() {
var $type = $(this).data().type;
attributesData[$selectType][$type] = $(this).prop("checked");
});
// Capture "field-type" within the dataType selected
$(this).find('.field-type').find('select').children("option:selected").each(function () {
attributesData[$selectType].dateFormat = $(this).index();
});
attributesArray.push(attributesData);
});
};
// Determine the Append input length
function inputAppendLength() {
$('.add-target').each(function(i) {
if($(this).children('.input-append:not(:hidden)').length == 1) {
$(this).children('.input-append').each(function() {
if($(this).children('div').hasClass('tab-content')) {
var btnLength = $(this).children('.btn').length;
$(this).find('.btn').eq(btnLength-2).addClass('last');
$(this).find('.remove-input').addClass('hide');
} else {
var mediumLength = $(this).children('.input-medium').length;
$(this).children('.input-medium').eq(mediumLength-1).addClass('last');
$(this).children('.remove-input').addClass('hide');
}
});
} else {
$(this).children('.input-append').each(function() {
if($(this).children('div').hasClass('tab-content')) {
$(this).find('.btn').removeClass('last');
$(this).find('.remove-input').removeClass('hide');
} else {
$(this).children('.input-medium').removeClass('last');
$(this).children('.remove-input').removeClass('hide');
}
});
}
});
};
// Role Attribute Template Data
function setData(l, type, ol) {
var fields = "role[attribute_fields]",
data = {
_add_more: ["add_more_" +l, fields+"["+l+"]["+type+"][add_more]"],
_calendar: ["calendar_" +l, fields+"["+l+"]["+type+"][calendar]"],
_cross_lang: ["cross_lang_" +l, fields+"["+l+"]["+type+"][cross_lang]"],
_disabled: ["disabled_" +l, fields+"["+l+"][disabled]"],
_format: ["format_" +l, fields+"["+l+"]["+type+"][format]"],
_initial: ["initial_" +l, fields+"["+l+"]["+type+"][initial]"],
_is_range: ["is_range_" +l, fields+"["+l+"]["+type+"][is_range]"],
_key: ["key_" +l, fields+"["+l+"][key]"],
_markup: fields+"["+l+"][markup]",
_option_list: ["option_list_"+l+"_"+ol, fields+"["+l+"]["+type+"][option_list]["+ol+"]", "option_list_"+ol],
_placeholder: ["placeholder_" +l, fields+"["+l+"]["+type+"][placeholder]"],
_title_translations: ["title_translations_" +l, fields+"["+l+"][title_translations]"],
_to_delete: ["to_delete_" +l, fields+"["+l+"][to_delete]"],
_to_search: ["to_search_" +l, fields+"["+l+"][to_search]"],
};
return data;
}
// Get Default Address Form
function getAddressForm(trigger, element, decide) {
if(decide) {
addressVal.length = addressArray.length = 0;
var addressAllVal = [];
var inputNameArray = [];
trigger.parents('.input-append').find('.tab-pane').each(function() {
var adderssText = $(this).children('input[type="text"]').val(),
addersshidden = '',
addressData = {},
inputName = [];
$(this).children('input:not(:first)').each(function(j) {
var name = $(this).attr('name'),
val = $(this).val();
addersshidden += val;
addressData[name] = val;
inputName.push(name);
});
addressArray.push(addressData);
addressAllVal.push(adderssText);
inputNameArray.push(inputName);
if(adderssText != addersshidden) {
addressVal.push(false);
} else {
addressVal.push(true);
}
});
element.find('.tab-pane').each(function(i) {
$(this).find('textarea, input[type="text"]').each(function(j) {
$(this).attr('name',inputNameArray[i][j]);
});
if(addressVal[i]) {
$(this).find('textarea, input[type="text"]').each(function(j) {
$(this).val(addressArray[i][$(this).attr('name')]);
});
} else {
$(this).find('textarea').val(addressAllVal[i]);
$(this).find('input[type="text"]').each(function(j) {
$(this).val('');
});
}
});
};
element.off('show');
};
// Return Address Form
function returnAddressForm(element, decide) {
if(decide) {
addressArray.length = 0;
element.find('.tab-pane').each(function(i) {
var addressData = {};
$(this).find('textarea, input[type="text"]').each(function(j) {
var name = $(this).attr('name'),
val = $(this).val();
addressData[name] = val;
});
addressArray.push(addressData);
});
$.map(addressInputId, function(n, i) {
var v = '';
$('#'+n).find('input[type="hidden"]').each(function() {
$(this).val(addressArray[i][$(this).attr('name')]);
v += addressArray[i][$(this).attr('name')]
});
$('#'+n).find('input[type="text"]').each(function() {
$(this).val(v);
});
});
};
returnDecide = false;
};
$(function() {
appendIndex = null;
if($('#new-user-forms').length) {
addressVal = [];
addressArray = [];
addressInputId = [];
roleType = null;
returnDecide = false;
$('.returnDecide').on(clickEvent, function() {
returnDecide = true;
})
$('#address-field').on('hidden', function () {
$('.btn[data-toggle="modal"]').removeClass('active').blur();
$(this).find('.nav-tabs > li').removeClass('active').eq(0).addClass('active');
$(this).find('.tab-content > .tab-pane').removeClass('active in').eq(0).addClass('active in');
$(this).on('show', getAddressForm(null, $(this), false));
returnAddressForm($(this), returnDecide)
});
$('.control-group').delegate('.btn[data-toggle="modal"]', 'click', function() {
var $trigger = $(this);
addressInputId.length = 0;
$(this).parents('.input-append').find('.tab-pane').each(function() {
addressInputId.push($(this).attr('id'));
});
$('#address-field').on('show', getAddressForm($trigger, $('#address-field'), true));
});
$('#new-user-forms').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
if($(this).hasClass('togglebox')) {
if($(this).hasClass('disabled')) {
$(this).find('.toggle-check')
.attr('value', 'false')
.parents('.attributes')
.removeClass('disabled')
.find('.attributes-body')
.fadeIn(300);
} else {
$(this).find('.toggle-check')
.attr('value', 'true')
.parents('.attributes')
.addClass('disabled')
.find('.attributes-body')
.fadeOut(300);
}
$(this).toggleClass('disabled');
};
if($(this).hasClass('remove-input')) {
$(this).parents('.input-append').fadeOut(300, function() {
inputAppendLength();
});
};
if($(this).hasClass('trigger')) {
appendIndex = $(this).parents('.controls').find('.input-append').length;
roleType = $(this).data('roles')
if($(this).hasClass('textInput')) {
$("#template-text").tmpl().appendTo($(this).parents('.controls').find('.add-target'));
} else if ($(this).hasClass('textLengInput')) {
$("#template-text-language").tmpl().appendTo($(this).parents('.controls').find('.add-target'));
} else if ($(this).hasClass('address')) {
$("#template-address").tmpl().appendTo($(this).parents('.controls').find('.add-target'));
}
inputAppendLength();
};
event.preventDefault();
});
inputAppendLength();
} else {
attributesArray = [];
attributesLength = $('#attributes-area .attributes').length;
attributesHeaderLength = null;
templateType = null;
attributeIndex = null;
if($('.add-target').length) {
inputAppendLength();
}
if(!$('.attributes').length) {
$('#attributes-area').addClass('clickHere');
} else {
temporary();
};
$('.add-attributes').on(clickEvent, function() {
if($('#attributes-area').hasClass('clickHere')) {
$('#attributes-area').removeClass('clickHere');
};
attributesHeaderLength = $('.attributes:not(:hidden)').length+1;
$("#template-attributes").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo( "#attributes-area" );
$('.toggle-check').togglebox();
attributesLength = $('#attributes-area .attributes').length;
});
$('.attributes.default').each(function(i) {
$(this).children('.field-type').not('.default').hide();
$(this).find('input[type="text"]').on('keyup', function() {
$(this).trigger("checking");
});
$(this).find('input[type="radio"], input[type="checkbox"], select').change(function() {
$(this).trigger("checking");
});
$(this).delegate('input[type="text"], input[type="radio"], input[type="checkbox"], select', 'checking', function(e) {
var e = e.target.type,
$data = $(this).data().type;
switch(e) {
case 'text':
var val = $(this).val();
if(!$(this).parents('.field-type').length) {
$data = attributesArray[i][$data];
} else if(!$(this).parents('.add-target').length) {
$data = attributesArray[i].select[$data];
} else {
appendIndex = $(this).parent('.input-append').index()
optionIndex = $(this).index()
$data = attributesArray[i].select.option[appendIndex][optionIndex];
}
if(val != $data) {
$(this).parents('.attributes').find('.reply').removeClass('hide');
}
break;
case 'radio':
var checked = $(this).prop("checked");
$data = attributesArray[i][$data];
if(checked != $data) {
$(this).parents('.attributes').find('.reply').removeClass('hide');
}
break;
case 'checkbox':
var checked = $(this).prop("checked");
$data = attributesArray[i].select[$data];
if(checked != $data) {
$(this).parents('.attributes').find('.reply').removeClass('hide');
}
break;
case 'select-one':
var ref,
$data = attributesArray[i].select.name;
$(this).children("option:selected").each(function() {
ref = $(this).attr('ref');
});
if(ref != $data) {
$(this).parents('.attributes').find('.reply').removeClass('hide');
}
break;
};
});
$(this).delegate('.reply', clickEvent, function() {
var $bodyText = $(this).parent('.attributes-header').siblings('.attributes-body').find('input[type="text"]'),
$bodyRadio = $(this).parent('.attributes-header').siblings('.attributes-body').find('input[type="radio"]'),
$bodySelected = $(this).parent('.attributes-header').siblings('.attributes-body').find('.dataType').children("option"),
$fieldTypeO = $(this).parent('.attributes-header').siblings('.field-type.default'),
$fieldTypeN = $(this).parent('.attributes-header').siblings('.field-type').not('.default');
$bodyText.each(function() {
var $type = $(this).data().type;
$(this).val(attributesArray[i][$type]);
});
$bodyRadio.each(function() {
var $type = $(this).data().type;
$(this).prop("checked", attributesArray[i][$type])
});
$fieldTypeO.find('input[type="text"]').each(function() {
var $type = $(this).data().type;
if(!$type.match('option_lang')) {
$(this).val(attributesArray[i].select[$type]);
}
});
$fieldTypeO.find('.add-target').find('.input-append').each(function(k) {
$(this).children('input[type="text"]').each(function(j) {
$(this).val(attributesArray[i].select.option[k][j]);
// var val = $(this).val();
// append.push(val);
});
})
$fieldTypeO.find('input[type="checkbox"], input[type="radio"]').each(function() {
var $type = $(this).data().type;
$(this).prop("checked", attributesArray[i].select[$type]);
});
$fieldTypeO.find('select').children("option").eq(attributesArray[i].select.dateFormat).prop('selected',true);
$bodySelected.eq(attributesArray[i].select.index).prop('selected',true);
$fieldTypeO.show();
$fieldTypeN.empty().hide();
$(this).addClass('hide')
return false
})
});
$('#attributes-area').delegate('.togglebox, .delete, .trigger, .remove-input', clickEvent, function(event) {
if($(this).hasClass('togglebox')) {
if($(this).hasClass('disabled')) {
$(this).find('.toggle-check')
.attr('value', 'false')
.parents('.attributes')
.removeClass('disabled')
.find('input, select')
.removeAttr('disabled')
.end('.attributes')
.find('.btn-group .btn')
.removeClass('disabled')
.end().find('.attribute_field_disabled').attr('value', 'false');
if($(this).parents('.attributes').find('.dataType').children("option:selected").attr('ref')) {
$(this).parents('.attributes').find('.field-type').addClass('in').find('.control-group').delay(150).fadeIn(300);
}
} else {
$(this).find('.toggle-check')
.attr('value', 'true')
.parents('.attributes')
.addClass('disabled')
.find('.attributes-body input, .attributes-body select')
.attr({'disabled': 'disabled'})
.end('.attributes')
.find('.btn-group .btn')
.addClass('disabled')
.end().find('.attribute_field_disabled').attr('value', 'true')
.end().find('.field-type .control-group').fadeOut(300, function() {
$(this).parent('.field-type').removeClass('in');
});
}
$(this).toggleClass('disabled');
};
if($(this).hasClass('delete')) {
$(this).parents('.attributes').fadeOut(300, function() {
$('.attributes:not(:hidden)').each(function(i) {
$(this).find('.attributes-header h4 span').text(i+1);
});
attributesHeaderLength = $('.attributes:not(:hidden)').length+1;
if(!$('.attributes:not(:hidden)').length) {
$('#attributes-area').addClass('clickHere');
};
}).find('.attribute_field_to_delete').attr('value', 'true');;
};
if($(this).hasClass('trigger')) {
appendIndex = $(this).parents('.controls').find('.input-append').length;
attributeIndex = $(this).parents('.attributes').index();
$("#template-input-append").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo($(this).parents('.controls').find('.add-target'));
inputAppendLength();
};
if($(this).hasClass('remove-input')) {
$(this).parent('.input-append').fadeOut(300, function() {
inputAppendLength();
});
}
event.preventDefault();
});
$('#attributes-area').delegate('.dataType', 'change', function() {
$(this).children("option:selected").each(function () {
var target = $(this).parents('.attributes').find('.field-type').not('.default');
attributeIndex = $(this).parents('.attributes').index();
appendIndex = $(this).parents('.attributes').find('.add-target').find('.input-append').length;
if($(this).parents('.attributes').hasClass('default')){
var i = $(this).parents('.attributes').index()
if($(this).attr('ref') == attributesArray[i].select.name) {
$(this).parents('.attributes').find('.field-type.default').show()
target.empty().hide();
} else {
$(this).parents('.attributes').find('.field-type.default').hide()
if($(this).attr('ref')) {
templateType = $(this).attr('ref');
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
$("#template-type").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo(target);
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
inputAppendLength();
}
} else {
target.removeAttr('class').addClass('field-type fade')
target.empty();
};
target.show();
}
} else {
if($(this).attr('ref')) {
templateType = $(this).attr('ref');
target.removeAttr('class').addClass('field-type fade in ' + templateType).empty();
$("#template-type").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo(target);
if(templateType == 'typeB' || templateType == 'typeE' || templateType == 'typeF') {
inputAppendLength();
}
} else {
target.removeAttr('class').addClass('field-type fade')
target.empty();
};
}
});
});
}
});
@@ -0,0 +1,29 @@
$(function() {
var $btnW = null,
$textareaLangBtnGroup = $('.textarea-lang > .btn-group'),
$textareaLang = $('.textarea-lang'),
$textareaTab = $('.textarea-lang > .tab-pane'),
$textarea = $('.textarea-lang > .tab-pane > .resizable');
$textareaLangBtnGroup.each(function() {
$btnW = 4
$(this).find('.btn').each(function() {
$btnW += $(this).outerWidth(true);
$(this).on('click', function() {
var $id = $($(this).attr('href'));
if($id.find('.ui-wrapper').height() < 96) {
$id.find('.ui-wrapper').height(96)
}
})
});
});
$textarea.each(function() {
$(this).width($btnW+100);
});
$textarea.resizable({
maxHeight: 250,
maxWidth: 500,
minHeight: 100,
minWidth: $btnW+114,
handles: "se",
});
});
+143
View File
@@ -0,0 +1,143 @@
(function() {
var root = (typeof exports == 'undefined' ? window : exports);
var config = {
// Ensure Content-Type is an image before trying to load @2x image
// https://github.com/imulus/retinajs/pull/45)
check_mime_type: true
};
root.Retina = Retina;
function Retina() {}
Retina.configure = function(options) {
if (options == null) options = {};
for (var prop in options) config[prop] = options[prop];
};
Retina.init = function(context) {
if (context == null) context = root;
var existing_onload = context.onload || new Function;
context.onload = function() {
var images = document.getElementsByTagName("img"), retinaImages = [], i, image;
for (i = 0; i < images.length; i++) {
image = images[i];
retinaImages.push(new RetinaImage(image));
}
existing_onload();
}
};
Retina.isRetina = function(){
var mediaQuery = "(-webkit-min-device-pixel-ratio: 1.5),\
(min--moz-device-pixel-ratio: 1.5),\
(-o-min-device-pixel-ratio: 3/2),\
(min-resolution: 1.5dppx)";
if (root.devicePixelRatio > 1)
return true;
if (root.matchMedia && root.matchMedia(mediaQuery).matches)
return true;
return false;
};
root.RetinaImagePath = RetinaImagePath;
function RetinaImagePath(path, at_2x_path) {
this.path = path;
if (typeof at_2x_path !== "undefined" && at_2x_path !== null) {
this.at_2x_path = at_2x_path;
this.perform_check = false;
} else {
this.at_2x_path = path.replace(/\.\w+$/, function(match) { return "@2x" + match; });
this.perform_check = true;
}
}
RetinaImagePath.confirmed_paths = [];
RetinaImagePath.prototype.is_external = function() {
return !!(this.path.match(/^https?\:/i) && !this.path.match('//' + document.domain) )
}
RetinaImagePath.prototype.check_2x_variant = function(callback) {
var http, that = this;
if (this.is_external()) {
return callback(false);
} else if (!this.perform_check && typeof this.at_2x_path !== "undefined" && this.at_2x_path !== null) {
return callback(true);
} else if (this.at_2x_path in RetinaImagePath.confirmed_paths) {
return callback(true);
} else {
http = new XMLHttpRequest;
http.open('HEAD', this.at_2x_path);
http.onreadystatechange = function() {
if (http.readyState != 4) {
return callback(false);
}
if (http.status >= 200 && http.status <= 399) {
if (config.check_mime_type) {
var type = http.getResponseHeader('Content-Type');
if (type == null || !type.match(/^image/i)) {
return callback(false);
}
}
RetinaImagePath.confirmed_paths.push(that.at_2x_path);
return callback(true);
} else {
return callback(false);
}
}
http.send();
}
}
function RetinaImage(el) {
this.el = el;
this.path = new RetinaImagePath(this.el.getAttribute('src'), this.el.getAttribute('data-at2x'));
var that = this;
this.path.check_2x_variant(function(hasVariant) {
if (hasVariant) that.swap();
});
}
root.RetinaImage = RetinaImage;
RetinaImage.prototype.swap = function(path) {
if (typeof path == 'undefined') path = this.path.at_2x_path;
var that = this;
function load() {
if (! that.el.complete) {
setTimeout(load, 5);
} else {
that.el.setAttribute('width', that.el.offsetWidth);
that.el.setAttribute('height', that.el.offsetHeight);
that.el.setAttribute('src', path);
}
}
load();
}
if (Retina.isRetina()) {
Retina.init(root);
}
})();
+66
View File
@@ -0,0 +1,66 @@
mSet = function() {
if($('.m_set_swich').prop('checked')) {
$('.m_set').fadeTo(300, 1).find('input').removeAttr('disabled');
} else {
$('.m_set').fadeTo(300, .33).find('input').attr('disabled','disabled');
};
};
$(function() {
if($('.terms').length) {
$('.terms').each(function() {
if($(this).prop('checked')) {
$(this).closest('.control-group').next('.control-group').show();
};
$(this).on({
change: function() {
$(this).closest('.control-group').next('.control-group').slideToggle();
}
});
});
};
if($('.m_set_swich').length) {
mSet();
$('.m_set_swich').on({
change: function() {
mSet();
},
});
$('.m-theme').each(function() {
if($(this).prop('checked')) {
$(this).closest('li').addClass('active');
};
$(this).on({
change: function() {
$(this).closest('li').addClass('active').siblings('li').removeClass('active');
},
});
});
}
if($('.ob-theme').length) {
$('.ob-theme').each(function() {
if($(this).prop('checked')) {
$(this).closest('li').addClass('active');
};
$(this).on({
change: function() {
$(this).closest('li').addClass('active').siblings('li').removeClass('active');
},
});
});
}
if($('.set-sidebar-state').length) {
if(window.localStorage.getItem('sidebarState') == 1) {
$('.set-sidebar-state').prop('checked',true).parent('.togglebox').removeClass('disabled');
}
$('.set-sidebar-state').on({
change: function() {
if($(this).prop('checked')) {
sidebarState(1);
} else {
sidebarState(0);
}
}
})
}
})
+106
View File
@@ -0,0 +1,106 @@
!function ($) {
$.fn.h6Size = function () {
$h6 = this;
$h6.each(function(i) {
var W = $(this).width()-$(this).find('.toggle-control').width()-$(this).children('b').outerWidth(true)-5;
$(this).children('span').width(W);
});
};
}(window.jQuery);
$(function() {
// $('.toggle-check').togglebox();
var $mapTree = $('.map-tree'),
$mapTreeItem = $mapTree.children('li'),
$mapItemH6 = $mapTree.find('h6');
var mapItem = function(w) {
var WinW = $(window).width(),
W = null;
if(WinW < 767) {
W = w;
} else {
W = (w-64)/2;
};
return W;
};
$('#map-tree-language').css('margin-left',ml = function() {
var W = null;
$(this).children('li').map(function(i, v) {
W -= $(v).width()/2;
});
return W;
});
$mapTree.each(function(i) {
$('.line').append("<ul class='line"+(i+1)+" fade'/>");
if(i < 1) {
$('.line'+(i+1)).addClass("in active");
};
$(this).children('li').each(function(j) {
$('.line').children('.line'+(i+1)).append("<li/>");
});
});
$mapTreeItem.children('h6').find('span').before(function() {
var I = ($(this).parents('li').index()+1);
if (I < 10) {
I = "0"+I;
}
return "<b>" + I + "</b>";
});
$mapTreeItem.width(mapItem($mapTree.width()))
$mapItemH6.h6Size();
$mapTree.each(function() {
$(this).masonry({
itemSelector: '.map-tree > li',
gutter: 60,
});
$(this).masonry('on', 'layoutComplete', function(msnryInstance, laidOutItems) {
// console.log(msnryInstance.element)
var element = msnryInstance.element;
$(element).children('li').children('h6').each(function(i) {
$('ul.line'+$(element).index()).children('li').eq(i).css('top', ($(this).offset().top-$('ul.line'+$(element).index()).offset().top)+15);
});
});
});
$mapTree.each(function(j) {
$(this).children('li').children('h6').each(function(i) {
$('ul.line'+(j+1)).children('li').eq(i).css('top',($(this).offset().top-$('ul.line'+(j+1)).offset().top)+15);
});
$(this).children('li').on('mouseenter', function() {
$('ul.line'+(j+1)).children('li').eq($(this).index()).css({
'background-color': '#0088cc',
'z-index': 1,
})
});
$(this).children('li').on('mouseleave', function() {
$('ul.line'+(j+1)).children('li').eq($(this).index()).css({
'background-color': '#DBDBDB',
'z-index': 0,
})
});
});
$('#map-tree-language a[data-toggle="tab"]').on('shown', function (e) {
var target = $(e.target).attr('href');
// console.log($(target).index())
$('ul.line'+$(target).index()).addClass("in active").siblings().removeClass("in active");
$mapTreeItem.width(mapItem($(target).width()))
// $mapTree.map(function(i,v){
// console.log(v.id +" : " +$(v).width() )
// })
$mapItemH6.h6Size();
$(target).masonry({
itemSelector: '.map-tree > li',
gutter: 60,
});
});
$(window).resize(function() {
var W = null;
$mapTree.map(function(i,v){
if($(v).width() > 0) {
W = $(v).width();
};
});
$mapTreeItem.width(mapItem(W));
$mapItemH6.h6Size();
});
});
+2 -2
View File
@@ -9,7 +9,7 @@ function checkTagsQuantity() {
}
function checkedLength() {
var $card = $('.card'),
var $tagsList = $('#tags-list'),
$moduleTags,
$defaultTags,
$toDefault;
@@ -97,7 +97,7 @@ function checkedLength() {
};
};
}
$card.on('click', function() {
$tagsList.delegate('.card', 'click', function() {
reload_links();
});
$('#selectAllTags').on('click', function() {
@@ -0,0 +1,84 @@
$(function() {
// var mixedMode = [{
// name: "htmlmixed"
// }, {
// name: "css"
// }, {
// name: "javascript"
// }];
if(/MSIE 8.0/g.test($ua) || /MSIE 9.0/g.test($ua)) {
$('#code-theme').closest('.btn-group').hide();
}
if(!window.localStorage.getItem('code-theme')) {
window.localStorage.setItem('code-theme', 'default')
};
$(window).resize(function() {
getH();
})
getH = function() {
H = $(window).height();
H = H-$('#orbit-bar').height();
H = H-parseInt($('.wrap-inner').css('padding-top'))-parseInt($('.wrap-inner').css('padding-bottom'));
H = H-$('.wrap-inner > h3').outerHeight()-$('#code-tab').outerHeight()-28;
setH();
};
setH = function() {
$('.CodeMirror').css('height',H);
};
codeEditor = [];
$(".code").each(function(i) {
var cE = "cE"+i;
var cE = $(this).codemirror({
mode: $(this).data('mode'),
styleActiveLine: true,
lineNumbers: true,
lineWrapping: true,
autoCloseBrackets: true,
autoCloseTags: true,
tabMode: "indent",
tabSize: 4,
indentUnit: 4,
indentWithTabs: true,
});
cE.setOption("theme", window.localStorage.getItem('code-theme'));
CodeMirror.commands["selectAll"](cE);
var range = { from: cE.getCursor(true), to: cE.getCursor(false) };
cE.autoFormatRange(range.from, range.to);
codeEditor.push(cE);
$('#code-theme > li').eq(window.localStorage.getItem('lidx')).addClass('active')
});
getH();
$('.CodeMirror-sizer').each(function(i) {
if($(this).height() < H ) {
$(this).siblings('.CodeMirror-gutters').css('height',H-30);
}
});
$('#code-theme').delegate('a', clickEvent, function(e) {
theme = $(this).attr('href');
lidx = $(this).parent('li').index();
window.localStorage.setItem('code-theme', theme);
window.localStorage.setItem('lidx', lidx);
var j = null;
$('.tab-pane').each(function() {
if($(this).hasClass('in')) {
j = $(this).index()
}
});
codeEditor[j].setOption("theme", theme);
$(this).parent('li').addClass('active').siblings('li').removeClass('active')
e.preventDefault();
});
$('a[data-toggle="tab"]').on('shown', function (e) {
var j = null;
$('.tab-pane').each(function() {
if($(this).hasClass('in')) {
j = $(this).index()
}
});
codeEditor[j].setOption("theme", window.localStorage.getItem('code-theme'));
});
setTimeout(sethide, 1);
function sethide(){
$(".tab-pane:eq(0)").nextAll(".tab-pane").removeClass("active in");
};
});