Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1025893
jquery.scripts.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jun 13, 2:58 PM
Size
1 KB
Mime Type
text/plain
Expires
Sun, Jun 15, 2:58 PM (10 h, 34 m)
Engine
blob
Format
Raw Data
Handle
661587
Attached To
rTMST Themes.Modern-Store
jquery.scripts.js
View Options
function
jq
(
$selector
)
{
return
$selector
.
replace
(
/(\[|\]|\.)/g
,
'\\$1'
);
}
function
DBlocks
()
{
var
$me
=
this
;
this
.
selectors
=
[
'#lang'
,
'#currency'
,
'#login'
,
'#login-alt'
,
'#profile'
];
$
(
document
).
ready
(
function
()
{
$me
.
init
();
}
);
}
DBlocks
.
prototype
.
init
=
function
()
{
var
$manager
=
this
;
$
(
this
.
selectors
.
join
(
', '
)
).
click
(
function
(
$e
,
$now
)
{
var
$me
=
$
(
this
),
$parent
=
$me
.
parent
();
if
(
$parent
.
is
(
'.plashka-sel'
)
)
{
$parent
.
removeClass
(
'plashka-sel'
);
if
(
$now
===
undefined
||
$now
===
false
)
{
$
(
'#'
+
$me
.
attr
(
'id'
)
+
'-sel'
).
fadeOut
();
}
else
{
$
(
'#'
+
$me
.
attr
(
'id'
)
+
'-sel'
).
hide
();
}
}
else
{
$manager
.
hideOthers
(
$me
);
$parent
.
addClass
(
'plashka-sel'
);
$
(
'#'
+
$me
.
attr
(
'id'
)
+
'-sel'
).
fadeIn
();
}
return
false
;
}
);
$
(
'.icon-close'
).
click
(
function
()
{
$
(
'#login,#login-alt'
).
parent
().
removeClass
(
'plashka-sel'
);
$
(
'#login-sel, #login-alt-sel'
).
fadeOut
();
return
false
;
}
);
}
DBlocks
.
prototype
.
hideOthers
=
function
(
$current
)
{
$
(
this
.
selectors
.
join
(
', '
)
).
not
(
$current
).
each
(
function
()
{
var
$me
=
$
(
this
),
$parent
=
$me
.
parent
();
if
(
$parent
.
is
(
'.plashka-sel'
)
)
{
$me
.
trigger
(
'click'
,
[
true
]);
}
}
);
}
function
RatingManager
(
$url
)
{
this
.
Url
=
$url
;
}
RatingManager
.
prototype
.
makeVote
=
function
(
$vote
,
$prefix
,
$id
,
$size
)
{
var
$url
=
this
.
Url
.
replace
(
'#PREFIX#'
,
$prefix
).
replace
(
'#VOTE#'
,
$vote
).
replace
(
'#ID#'
,
$id
).
replace
(
'#SIZE#'
,
$size
);
$
.
get
(
$url
,
function
(
$response
)
{
if
(
$response
.
substring
(
0
,
5
)
==
'@err:'
)
{
alert
(
$response
.
substring
(
5
)
);
return
;
}
document
.
getElementById
(
'page_rating_'
+
$id
).
innerHTML
=
$response
;
}
)
}
$
(
document
).
ready
(
function
()
{
$
(
'#change-password'
).
click
(
function
(
$e
)
{
$
(
'#password-show'
).
hide
();
$
(
'#password-block'
).
fadeIn
();
return
false
;
}
);
});
new
DBlocks
();
Event Timeline
Log In to Comment