-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainscript.js
More file actions
103 lines (76 loc) · 3.14 KB
/
mainscript.js
File metadata and controls
103 lines (76 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
( function( $ ) {
'use strict';
create_svg( '.col-md-12', '.circle-svg-a a' );
create_svg( '.panel', '.circle-svg-a a' );
create_svg( '.panel', '.circle-svg-span span' );
function create_svg( c1, c2 )
{
/* Create circle animation from circle-svg-* class */
$( c1 ).on( 'click', c2, function( c ) {
var box = $( this );
var setX = parseInt( c.pageX - $( this ).offset().left );
var setY = parseInt( c.pageY - $( this ).offset().top );
var radius = $( box ).outerWidth() / 2;
if( $( box ).find( "svg" ).length === 0 )
{
$( box ).append( '<svg><circle class="circle-1" cx="' + setX + '" cy="' + setY + '" r="' + ( radius - 10 ) + '"></circle></svg>' );
}
$( box ).find( 'svg' ).css( 'opacity', '1' );
$( box ).find( 'svg' ).animate( { opacity: '0' }, { duration: 800, queue: false } );
var circle_1 = $( box ).find( ".circle-1" );
circle_1.attr( 'cx', setX );
circle_1.attr( 'cy', setY );
var start_radius = radius - 10;
$( circle_1 ).animate( { "r": radius }, {
duration: 350,
step: function( val ) {
circle_1.attr( "r", ( val + start_radius ) );
}
} );
} );
}
/* Social Icons Setup */
$( '.widget_core_user_links a' ).each( function() {
var mthis = $( this );
var class_attr = $( mthis ).attr( 'class' );
$( mthis ).children( 'span' ).addClass( class_attr );
} );
var panel_id = 0;
/* Panel toggle setup, identify panel toggle and collapse container */
$( '.panel-group .panel:not(.widget_core_content_hierarchy)' ).each( function() {
panel_id++;
if( $( this ).find( 'li.title' ).size() > 0 )
{
var a_link = $( this ).find( '.title' ).children();
var title = $( a_link ).text();
$( this ).prepend( '<div class="panel-heading circle-svg-a"></div>' );
$( this ).find( '.panel-heading' ).append( '<a onclick="return false;" class="panel-toggle" data-toggle="collapse" data-target=".pcollapse-0" href="#"></a>' );
$( this ).find( '.panel-toggle' ).append( '<span class="panel-icon"><i class="fa fa-angle-down"></i></span>' );
$( this ).find( '.panel-heading' ).append( '<span class="panel-title">' + title + '</span>' );
}
$( this ).find( '.panel-toggle' ).attr( 'data-target', '#pcollapse-' + panel_id );
$( this ).find( '.panel-toggle' ).addClass( ' collapsed' );
$( this ).find( '.panel-collapse' ).attr( 'id', 'pcollapse-' + panel_id );
if( $( this ).find( '.panel-heading' ).length > 0 )
{
$( this ).find( '.panel-collapse' ).addClass( ' collapse' );
}
} );
/* Replace star icons in #comment_rating containers */
$( '.star_rating' ).each( function() {
$( this ).css( 'visibility', 'hidden' );
var stars = parseInt( $( this ).find( '>div' ).text() );
$( this ).find( '>div' ).detach();
$( this ).attr( 'id', 'comment_rating' );
for( var i = 0; i < stars; i++ )
{
$( this ).append( '<span class="comment_rating raty_star_on"> </span>' );
}
var stars_off = 5 - stars;
for( var j = 0; j < stars_off; j++ )
{
$( this ).append( '<span class="comment_rating raty_star_off"> </span>' );
}
$( this ).css( 'visibility', 'visible' );
} );
} )( jQuery );