Switch to .min for compressed JS and CSS files.
* This moves our "development" versions from .dev.js to .js (same for css). * The compressed version then moves from .js to .min.js (same for css). By switching to the standard .min convention, it sets expectations for developers, and works nicely with existing tools such as ack. fixes #21633. git-svn-id: http://core.svn.wordpress.org/trunk@21592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5bf22749a3
commit
2710bcade1
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1 +1,86 @@
|
|||
.control-section .customize-section-title{font-family:Tahoma,Arial,sans-serif}.customize-section-title:after{right:auto;left:20px}#customize-header-actions .button-primary{float:left}#customize-header-actions img{float:left;margin-right:0;margin-left:4px}.customize-control{float:right}.customize-control-radio input,.customize-control-checkbox input{margin-right:0;margin-left:5px}.customize-section .dropdown{float:right}.customize-section .dropdown-content{float:right;margin-right:0;margin-left:16px;-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.customize-control .dropdown-arrow{right:auto;left:0;border-color:#ccc;border-style:solid;border-width:1px 0 1px 1px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.customize-control .dropdown-arrow:after{right:auto;left:4px}.customize-control-color .dropdown{margin-right:0;margin-left:5px}.customize-section input[type="text"].color-picker-hex,.customize-control-color .farbtastic-placeholder{float:right}.customize-section .customize-control-image .actions{text-align:left}.customize-control-image .library,.customize-control-image .actions,.customize-section .customize-control-image .library ul,.customize-section .customize-control-image .library li,.customize-section .customize-control-image .library-content{float:right}
|
||||
.control-section .customize-section-title {
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
}
|
||||
.customize-section-title:after {
|
||||
right: auto;
|
||||
left: 20px;
|
||||
}
|
||||
|
||||
#customize-header-actions .button-primary {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#customize-header-actions img {
|
||||
float: left;
|
||||
margin-right: 0;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.customize-control {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.customize-control-radio input,
|
||||
.customize-control-checkbox input {
|
||||
margin-right: 0;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Dropdowns
|
||||
*/
|
||||
.customize-section .dropdown {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.customize-section .dropdown-content {
|
||||
float: right;
|
||||
margin-right: 0px;
|
||||
margin-left: 16px;
|
||||
-webkit-border-radius: 0 3px 3px 0;
|
||||
border-radius: 0 3px 3px 0;
|
||||
}
|
||||
|
||||
.customize-control .dropdown-arrow {
|
||||
right: auto;
|
||||
left: 0;
|
||||
|
||||
border-color: #ccc;
|
||||
border-style: solid;
|
||||
border-width: 1px 0 1px 1px;
|
||||
-webkit-border-radius: 3px 0 0 3px;
|
||||
border-radius: 3px 0 0 3px;
|
||||
}
|
||||
|
||||
.customize-control .dropdown-arrow:after {
|
||||
right: auto;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Color Picker
|
||||
*/
|
||||
.customize-control-color .dropdown {
|
||||
margin-right: 0;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.customize-section input[type="text"].color-picker-hex,
|
||||
.customize-control-color .farbtastic-placeholder {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/*
|
||||
* Image Picker
|
||||
*/
|
||||
.customize-section .customize-control-image .actions {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.customize-control-image .library,
|
||||
.customize-control-image .actions,
|
||||
.customize-section .customize-control-image .library ul,
|
||||
.customize-section .customize-control-image .library li,
|
||||
.customize-section .customize-control-image .library-content {
|
||||
float: right;
|
||||
}
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
.control-section .customize-section-title {
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
}
|
||||
.customize-section-title:after {
|
||||
right: auto;
|
||||
left: 20px;
|
||||
}
|
||||
|
||||
#customize-header-actions .button-primary {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#customize-header-actions img {
|
||||
float: left;
|
||||
margin-right: 0;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.customize-control {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.customize-control-radio input,
|
||||
.customize-control-checkbox input {
|
||||
margin-right: 0;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Dropdowns
|
||||
*/
|
||||
.customize-section .dropdown {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.customize-section .dropdown-content {
|
||||
float: right;
|
||||
margin-right: 0px;
|
||||
margin-left: 16px;
|
||||
-webkit-border-radius: 0 3px 3px 0;
|
||||
border-radius: 0 3px 3px 0;
|
||||
}
|
||||
|
||||
.customize-control .dropdown-arrow {
|
||||
right: auto;
|
||||
left: 0;
|
||||
|
||||
border-color: #ccc;
|
||||
border-style: solid;
|
||||
border-width: 1px 0 1px 1px;
|
||||
-webkit-border-radius: 3px 0 0 3px;
|
||||
border-radius: 3px 0 0 3px;
|
||||
}
|
||||
|
||||
.customize-control .dropdown-arrow:after {
|
||||
right: auto;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
/*
|
||||
* Color Picker
|
||||
*/
|
||||
.customize-control-color .dropdown {
|
||||
margin-right: 0;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.customize-section input[type="text"].color-picker-hex,
|
||||
.customize-control-color .farbtastic-placeholder {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/*
|
||||
* Image Picker
|
||||
*/
|
||||
.customize-section .customize-control-image .actions {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.customize-control-image .library,
|
||||
.customize-control-image .actions,
|
||||
.customize-section .customize-control-image .library ul,
|
||||
.customize-section .customize-control-image .library li,
|
||||
.customize-section .customize-control-image .library-content {
|
||||
float: right;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
.control-section .customize-section-title{font-family:Tahoma,Arial,sans-serif}.customize-section-title:after{right:auto;left:20px}#customize-header-actions .button-primary{float:left}#customize-header-actions img{float:left;margin-right:0;margin-left:4px}.customize-control{float:right}.customize-control-radio input,.customize-control-checkbox input{margin-right:0;margin-left:5px}.customize-section .dropdown{float:right}.customize-section .dropdown-content{float:right;margin-right:0;margin-left:16px;-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.customize-control .dropdown-arrow{right:auto;left:0;border-color:#ccc;border-style:solid;border-width:1px 0 1px 1px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.customize-control .dropdown-arrow:after{right:auto;left:4px}.customize-control-color .dropdown{margin-right:0;margin-left:5px}.customize-section input[type="text"].color-picker-hex,.customize-control-color .farbtastic-placeholder{float:right}.customize-section .customize-control-image .actions{text-align:left}.customize-control-image .library,.customize-control-image .actions,.customize-section .customize-control-image .library ul,.customize-section .customize-control-image .library li,.customize-section .customize-control-image .library-content{float:right}
|
File diff suppressed because one or more lines are too long
|
@ -1,534 +0,0 @@
|
|||
body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#customize-controls a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.customize-section {
|
||||
border-top: 1px solid #fff;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.control-section.customize-section:hover,
|
||||
.control-section.customize-section.open {
|
||||
border-top-color: #808080;
|
||||
}
|
||||
|
||||
.control-section.customize-section:hover {
|
||||
border-bottom-color: #6d6d6d;
|
||||
}
|
||||
|
||||
.customize-section.open:hover {
|
||||
border-bottom-color: #dfdfdf;
|
||||
}
|
||||
|
||||
.customize-section:last-child {
|
||||
box-shadow: 0 1px 0 0px #fff;
|
||||
}
|
||||
|
||||
.customize-section-title {
|
||||
margin: 0;
|
||||
padding: 15px 20px;
|
||||
position: relative;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.cannot-expand .customize-section-title {
|
||||
cursor: auto;
|
||||
}
|
||||
|
||||
.customize-section-content {
|
||||
display: none;
|
||||
padding: 10px 20px 15px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.control-section .customize-section-title {
|
||||
padding: 10px 20px;
|
||||
font-size: 15px;
|
||||
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
font-weight: normal;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
background: #f5f5f5;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, from(#eee), to(#f5f5f5));
|
||||
background-image: -webkit-linear-gradient(bottom, #eee, #f5f5f5);
|
||||
background-image: -moz-linear-gradient(bottom, #eee, #f5f5f5);
|
||||
background-image: -o-linear-gradient(bottom, #eee, #f5f5f5);
|
||||
background-image: linear-gradient(to top, #eee, #f5f5f5);
|
||||
}
|
||||
|
||||
.control-section:hover .customize-section-title,
|
||||
.control-section .customize-section-title:hover,
|
||||
.control-section.open .customize-section-title {
|
||||
color: #fff;
|
||||
text-shadow: 0 -1px 0 #333;
|
||||
background: #808080;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, from(#6d6d6d), to(#808080));
|
||||
background-image: -webkit-linear-gradient(bottom, #6d6d6d, #808080);
|
||||
background-image: -moz-linear-gradient(bottom, #6d6d6d, #808080);
|
||||
background-image: -o-linear-gradient(bottom, #6d6d6d, #808080);
|
||||
background-image: linear-gradient(to top, #6d6d6d, #808080);
|
||||
}
|
||||
|
||||
.control-section.open .customize-section-title {
|
||||
border-bottom: 1px solid #6d6d6d;
|
||||
}
|
||||
|
||||
.customize-section.open .customize-section-content {
|
||||
display: block;
|
||||
background: #fdfdfd;
|
||||
}
|
||||
|
||||
.customize-section-title:after {
|
||||
content: '';
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: #ccc transparent;
|
||||
border-style: solid;
|
||||
border-width: 6px 6px 0;
|
||||
position: absolute;
|
||||
top: 25px;
|
||||
right: 20px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.cannot-expand .customize-section-title:after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-section-title:hover:after {
|
||||
border-color: #aaa transparent;
|
||||
}
|
||||
|
||||
.control-section .customize-section-title:hover:after {
|
||||
border-color: #eee transparent;
|
||||
}
|
||||
|
||||
.control-section .customize-section-title:after {
|
||||
top: 15px;
|
||||
}
|
||||
|
||||
#customize-info .customize-section-content {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#customize-info .preview-notice {
|
||||
font-size: 13px;
|
||||
line-height: 24px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#customize-info .theme-name {
|
||||
font-size: 20px;
|
||||
font-weight: 200;
|
||||
line-height: 24px;
|
||||
color: #333;
|
||||
display: block;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
#customize-info .theme-screenshot {
|
||||
width: 258px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#customize-info .theme-description {
|
||||
margin-top: 1em;
|
||||
color: #777;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
#customize-controls .submit {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#customize-theme-controls > ul,
|
||||
#customize-theme-controls .customize-section-content {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#customize-header-actions .button-primary {
|
||||
float: right;
|
||||
margin-top: 11px;
|
||||
}
|
||||
|
||||
#customize-header-actions img {
|
||||
display: none;
|
||||
float: right;
|
||||
margin-top: 13px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.saving #customize-header-actions img {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-control {
|
||||
width: 100%;
|
||||
float: left;
|
||||
clear: both;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.customize-control-title {
|
||||
display: block;
|
||||
line-height: 24px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.customize-control select,
|
||||
.customize-control input[type="text"],
|
||||
.customize-control input[type="radio"],
|
||||
.customize-control input[type="checkbox"],
|
||||
.customize-control-color .color-picker,
|
||||
.customize-control-checkbox label,
|
||||
.customize-control-upload div {
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.customize-control input[type="text"] {
|
||||
width: 98%;
|
||||
line-height: 18px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.customize-control select {
|
||||
min-width: 50%;
|
||||
max-width: 100%;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.customize-control-checkbox input {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.customize-control-radio {
|
||||
padding: 5px 0 10px;
|
||||
}
|
||||
|
||||
.customize-control-radio .customize-control-title {
|
||||
margin-bottom: 0;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.customize-control-radio label {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.customize-control-radio input {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#customize-preview iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/*
|
||||
* Style for custom settings
|
||||
*/
|
||||
|
||||
/*
|
||||
* Dropdowns
|
||||
*/
|
||||
.customize-section .dropdown {
|
||||
float: left;
|
||||
display: block;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.customize-section .dropdown-content {
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
min-width: 30px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
margin-right: 16px;
|
||||
padding: 4px 5px;
|
||||
background-color: #eee;
|
||||
border: 1px solid #ccc;
|
||||
-webkit-border-radius: 3px 0 0 3px;
|
||||
border-radius: 3px 0 0 3px;
|
||||
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.customize-control .dropdown-arrow {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 15px;
|
||||
|
||||
border-color: #ccc;
|
||||
border-style: solid;
|
||||
border-width: 1px 1px 1px 0;
|
||||
-webkit-border-radius: 0 3px 3px 0;
|
||||
border-radius: 0 3px 3px 0;
|
||||
}
|
||||
|
||||
.customize-control .dropdown-arrow:after {
|
||||
content: '';
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: #ccc transparent;
|
||||
border-style: solid;
|
||||
border-width: 4px 4px 0 4px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -1px;
|
||||
right: 4px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.customize-section .dropdown:hover .dropdown-content,
|
||||
.customize-control .dropdown:hover .dropdown-arrow {
|
||||
border-color: #aaa;
|
||||
}
|
||||
|
||||
.customize-section .dropdown:hover .dropdown-arrow:after {
|
||||
border-color: #aaa transparent;
|
||||
}
|
||||
|
||||
.customize-control .dropdown-status {
|
||||
display: none;
|
||||
max-width: 112px;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
/*
|
||||
* Color Picker
|
||||
*/
|
||||
.customize-control-color .color-picker-hex,
|
||||
.customize-control-color .farbtastic-placeholder {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-control-color.open .color-picker-hex,
|
||||
.customize-control-color.open .farbtastic-placeholder {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-control-color .dropdown {
|
||||
margin-right: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.customize-control-color .dropdown .dropdown-content {
|
||||
background-color: #fff;
|
||||
border: 1px solid rgba( 0, 0, 0, 0.15 );
|
||||
}
|
||||
|
||||
.customize-control-color .dropdown:hover .dropdown-content {
|
||||
border-color: rgba( 0, 0, 0, 0.25 );
|
||||
}
|
||||
|
||||
.customize-section input[type="text"].color-picker-hex {
|
||||
float: left;
|
||||
width: 85px;
|
||||
font-family: monospace;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* The centered cursor overlaps the placeholder in webkit. Hide it when selected. */
|
||||
.customize-section input[type="text"].color-picker-hex:focus::-webkit-input-placeholder {
|
||||
color: transparent;
|
||||
}
|
||||
.customize-section input[type="text"].color-picker-hex:-moz-placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.customize-control-color .farbtastic-placeholder {
|
||||
width: 100%;
|
||||
margin: 5px 0 10px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.customize-control-color .farbtastic {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/*
|
||||
* Image Picker
|
||||
*/
|
||||
.customize-control-image .library,
|
||||
.customize-control-image .actions {
|
||||
display: none;
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.customize-control-image.open .library,
|
||||
.customize-control-image.open .actions {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-image .dropdown-content {
|
||||
height: auto;
|
||||
min-height: 24px;
|
||||
min-width: 40px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-image .dropdown-status {
|
||||
padding: 4px 5px;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-image .preview-thumbnail img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 122px;
|
||||
max-height: 98px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-image .actions {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-image .library ul {
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
float: left;
|
||||
width: 100%;
|
||||
margin: 10px 0 0;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-image .library li {
|
||||
color: #999;
|
||||
float: left;
|
||||
padding: 3px 5px;
|
||||
margin: 0;
|
||||
border-style: solid;
|
||||
border-color: transparent;
|
||||
border-width: 1px 1px 0 1px;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-image .library li.library-selected {
|
||||
margin-bottom: -1px;
|
||||
padding-bottom: 4px;
|
||||
|
||||
color: #777;
|
||||
background: #fdfdfd;
|
||||
border-color: #dfdfdf;
|
||||
-webkit-border-radius: 3px 3px 0 0;
|
||||
border-radius: 3px 3px 0 0 ;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-image .library-content {
|
||||
display: none;
|
||||
width: 100%;
|
||||
float: left;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-image .library-content.library-selected {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-image .library .thumbnail {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-image .library .thumbnail:hover img {
|
||||
border-color: #21759b;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-image .library .thumbnail img {
|
||||
display: block;
|
||||
max-width: 90%;
|
||||
max-height: 80px;
|
||||
|
||||
margin: 5px auto;
|
||||
padding: 4px;
|
||||
background: #fff;
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-upload .upload-fallback,
|
||||
.customize-section .customize-control-image .upload-fallback {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-upload .upload-dropzone,
|
||||
.customize-section .customize-control-image .upload-dropzone {
|
||||
display: none;
|
||||
padding: 15px 10px;
|
||||
border: 3px dashed #dfdfdf;
|
||||
margin: 5px auto;
|
||||
text-align: center;
|
||||
color: #777;
|
||||
position: relative;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop,
|
||||
.customize-section .customize-control-image .upload-dropzone.supports-drag-drop {
|
||||
display: block;
|
||||
-webkit-transition: border-color 0.1s;
|
||||
-moz-transition: border-color 0.1s;
|
||||
-ms-transition: border-color 0.1s;
|
||||
-o-transition: border-color 0.1s;
|
||||
transition: border-color 0.1s;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-upload .library ul li,
|
||||
.customize-section .customize-control-image .library ul li {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop.drag-over,
|
||||
.customize-section .customize-control-image .upload-dropzone.supports-drag-drop.drag-over {
|
||||
border-color: #83b4d8;
|
||||
}
|
||||
|
||||
/**
|
||||
* iOS can't scroll iframes,
|
||||
* instead it expands the iframe size to match the size of the content
|
||||
*/
|
||||
.ios .wp-full-overlay {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ios #customize-preview {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ios #customize-controls .wp-full-overlay-sidebar-content {
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle cheaters.
|
||||
*/
|
||||
body.cheatin {
|
||||
min-width: 0;
|
||||
background: #f9f9f9;
|
||||
padding: 50px;
|
||||
}
|
||||
|
||||
body.cheatin p {
|
||||
max-width: 700px;
|
||||
margin: 0 auto;
|
||||
padding: 2em;
|
||||
font-size: 14px;
|
||||
background: #fff;
|
||||
border: 1px solid #dfdfdf;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -1 +1,235 @@
|
|||
body{direction:rtl;width:99.5%}.rtl #adminmenuback{left:auto;right:0;background-image:none}.rtl #adminmenuback,.rtl #adminmenuwrap{border-width:0 0 0 1px}#plupload-upload-ui{zoom:1}.post-com-count-wrapper a.post-com-count{float:none}#adminmenu .wp-submenu ul{width:99%}#adminmenu .wp-submenu .wp-submenu .wp-submenu,#adminmenu .wp-menu-open .wp-submenu .wp-submenu{border:1px solid #dfdfdf}.folded #adminmenu .wp-submenu{right:30px;top:-4px}#adminmenu .wp-submenu .wp-submenu-head{padding:6px 10px 6px 4px}#wpcontent #adminmenu .wp-submenu li.wp-submenu-head{padding:3px 10px 4px 4px}div.quicktags-toolbar input{min-width:0}.inline-edit-row fieldset label span.title{float:right}.inline-edit-row fieldset label span.input-text-wrap{margin-right:0}p.search-box{float:left}#bh{margin:7px 10px 0 0;float:left}.postbox div.inside,.wp-editor-wrap .wp-editor-container .wp-editor-area,#nav-menu-theme-locations .howto select{width:97.5%}div#dashboard-widgets{padding-right:0;padding-left:1px}#dashboard_quick_press h4{text-align:right}.tagchecklist span a{margin:4px -9px 0 0}.widefat th input{margin:0 5px 0 0}#TB_window{width:670px;position:absolute;top:50%;left:50%;margin-right:335px!important}#dashboard_plugins{direction:ltr}#dashboard_plugins h3.hndle{direction:rtl}#dashboard_incoming_links ul li,#dashboard_secondary ul li,#dashboard_primary ul li,p.row-actions{width:100%}#post-status-info{height:25px}p.submit{height:22px}form#widgets-filter{position:static}.menu-item-depth-0{margin-left:0}.menu-item-depth-1{margin-left:-30px}.menu-item-depth-2{margin-left:-60px}.menu-item-depth-3{margin-left:-90px}.menu-item-depth-4{margin-left:-120px}.menu-item-depth-5{margin-left:-150px}.menu-item-depth-6{margin-left:-180px}.menu-item-depth-7{margin-left:-210px}.menu-item-depth-8{margin-left:-240px}.menu-item-depth-9{margin-left:-270px}.menu-item-depth-10{margin-left:-300px}.menu-item-depth-11{margin-left:-330px}#menu-management,.nav-menus-php .menu-edit,#nav-menu-header .submitbox{zoom:1}.nav-menus-php label{max-width:90%!important}p.button-controls,.nav-menus-php .tabs-panel{max-width:90%}.nav-menus-php .major-publishing-actions .publishing-action{float:none}#wpbody #nav-menu-header label{float:none}#nav-menu-header{margin-top:-10px}#nav-menu-footer{margin-bottom:-20px}#update-nav-menu .publishing-action{max-width:200px}#nav-menus-frame #update-nav-menu .delete-action{margin-top:-25px;float:left}#menu-to-edit li{margin-top:-10px;margin-bottom:-10px}.sortable-placeholder{margin-top:0!important;margin-left:0!important;margin-bottom:13px!important;padding:0!important}.auto-add-pages{clear:both;float:none}#nav-menus-frame .open-label span{float:none;display:inline-block}#nav-menus-frame .delete-action{float:none}
|
||||
|
||||
body {
|
||||
direction: rtl;
|
||||
width: 99.5%;
|
||||
}
|
||||
|
||||
.rtl #adminmenuback {
|
||||
left: auto;
|
||||
right: 0;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.rtl #adminmenuback,
|
||||
.rtl #adminmenuwrap {
|
||||
border-width: 0 0 0 1px;
|
||||
}
|
||||
|
||||
#plupload-upload-ui {
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.post-com-count-wrapper a.post-com-count {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu ul {
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu .wp-submenu .wp-submenu,
|
||||
#adminmenu .wp-menu-open .wp-submenu .wp-submenu {
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
.folded #adminmenu .wp-submenu {
|
||||
right: 30px;
|
||||
top: -4px;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu .wp-submenu-head {
|
||||
padding: 6px 10px 6px 4px;
|
||||
}
|
||||
|
||||
#wpcontent #adminmenu .wp-submenu li.wp-submenu-head {
|
||||
padding: 3px 10px 4px 4px;
|
||||
}
|
||||
|
||||
div.quicktags-toolbar input {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.inline-edit-row fieldset label span.title {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.inline-edit-row fieldset label span.input-text-wrap {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
p.search-box {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#bh {
|
||||
margin: 7px 10px 0 0;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.postbox div.inside,
|
||||
.wp-editor-wrap .wp-editor-container .wp-editor-area,
|
||||
#nav-menu-theme-locations .howto select {
|
||||
width: 97.5%;
|
||||
}
|
||||
|
||||
/* without this dashboard widgets appear in one column for some screen widths */
|
||||
div#dashboard-widgets {
|
||||
padding-right: 0;
|
||||
padding-left: 1px;
|
||||
}
|
||||
|
||||
#dashboard_quick_press h4 {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.tagchecklist span a {
|
||||
margin: 4px -9px 0 0;
|
||||
}
|
||||
|
||||
.widefat th input {
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
|
||||
/* ---------- add by navid */
|
||||
#TB_window {
|
||||
width: 670px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-right: 335px !important;
|
||||
}
|
||||
|
||||
#dashboard_plugins {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
#dashboard_plugins h3.hndle {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
#dashboard_incoming_links ul li,
|
||||
#dashboard_secondary ul li,
|
||||
#dashboard_primary ul li,
|
||||
p.row-actions {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#post-status-info {
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
p.submit { /* quick edit and reply in edit-comments.php */
|
||||
height:22px;
|
||||
}
|
||||
|
||||
form#widgets-filter { /* fix widget page */
|
||||
position: static;
|
||||
}
|
||||
|
||||
/* nav menus
|
||||
.menu-max-depth-0 #menu-management { width: 460px; }
|
||||
.menu-max-depth-1 #menu-management { width: 490px; }
|
||||
.menu-max-depth-2 #menu-management { width: 520px; }
|
||||
.menu-max-depth-3 #menu-management { width: 550px; }
|
||||
.menu-max-depth-4 #menu-management { width: 580px; }
|
||||
.menu-max-depth-5 #menu-management { width: 610px; }
|
||||
.menu-max-depth-6 #menu-management { width: 640px; }
|
||||
.menu-max-depth-7 #menu-management { width: 670px; }
|
||||
.menu-max-depth-8 #menu-management { width: 700px; }
|
||||
.menu-max-depth-9 #menu-management { width: 730px; }
|
||||
.menu-max-depth-10 #menu-management { width: 760px; }
|
||||
.menu-max-depth-11 #menu-management { width: 790px; }
|
||||
*/
|
||||
.menu-item-depth-0 { margin-left: 0px; }
|
||||
.menu-item-depth-1 { margin-left: -30px; }
|
||||
.menu-item-depth-2 { margin-left: -60px; }
|
||||
.menu-item-depth-3 { margin-left: -90px; }
|
||||
.menu-item-depth-4 { margin-left: -120px; }
|
||||
.menu-item-depth-5 { margin-left: -150px; }
|
||||
.menu-item-depth-6 { margin-left: -180px; }
|
||||
.menu-item-depth-7 { margin-left: -210px; }
|
||||
.menu-item-depth-8 { margin-left: -240px; }
|
||||
.menu-item-depth-9 { margin-left: -270px; }
|
||||
.menu-item-depth-10 { margin-left: -300px; }
|
||||
.menu-item-depth-11 { margin-left: -330px; }
|
||||
|
||||
/*
|
||||
#menu-to-edit li dl {
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.ui-sortable-helper .menu-item-transport {
|
||||
margin-top: 13px;
|
||||
}
|
||||
|
||||
.ui-sortable-helper .menu-item-transport .menu-item-transport {
|
||||
margin-top: 0;
|
||||
}
|
||||
*/
|
||||
|
||||
#menu-management,
|
||||
.nav-menus-php .menu-edit,
|
||||
#nav-menu-header .submitbox {
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.nav-menus-php label {
|
||||
max-width: 90% !important;
|
||||
}
|
||||
|
||||
p.button-controls,
|
||||
.nav-menus-php .tabs-panel {
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
.nav-menus-php .major-publishing-actions .publishing-action {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#wpbody #nav-menu-header label {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#nav-menu-header {
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
||||
#nav-menu-footer {
|
||||
margin-bottom: -20px;
|
||||
}
|
||||
|
||||
#update-nav-menu .publishing-action {
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
#nav-menus-frame #update-nav-menu .delete-action {
|
||||
margin-top: -25px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#menu-to-edit li {
|
||||
margin-top: -10px;
|
||||
margin-bottom: -10px;
|
||||
}
|
||||
|
||||
.sortable-placeholder {
|
||||
margin-top: 0 !important;
|
||||
margin-left: 0 !important;
|
||||
margin-bottom: 13px !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.auto-add-pages {
|
||||
clear: both;
|
||||
float: none;
|
||||
}
|
||||
|
||||
#nav-menus-frame .open-label span {
|
||||
float: none;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#nav-menus-frame .delete-action {
|
||||
float: none;
|
||||
}
|
||||
|
|
|
@ -1,235 +0,0 @@
|
|||
|
||||
body {
|
||||
direction: rtl;
|
||||
width: 99.5%;
|
||||
}
|
||||
|
||||
.rtl #adminmenuback {
|
||||
left: auto;
|
||||
right: 0;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.rtl #adminmenuback,
|
||||
.rtl #adminmenuwrap {
|
||||
border-width: 0 0 0 1px;
|
||||
}
|
||||
|
||||
#plupload-upload-ui {
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.post-com-count-wrapper a.post-com-count {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu ul {
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu .wp-submenu .wp-submenu,
|
||||
#adminmenu .wp-menu-open .wp-submenu .wp-submenu {
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
.folded #adminmenu .wp-submenu {
|
||||
right: 30px;
|
||||
top: -4px;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu .wp-submenu-head {
|
||||
padding: 6px 10px 6px 4px;
|
||||
}
|
||||
|
||||
#wpcontent #adminmenu .wp-submenu li.wp-submenu-head {
|
||||
padding: 3px 10px 4px 4px;
|
||||
}
|
||||
|
||||
div.quicktags-toolbar input {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.inline-edit-row fieldset label span.title {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.inline-edit-row fieldset label span.input-text-wrap {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
p.search-box {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#bh {
|
||||
margin: 7px 10px 0 0;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.postbox div.inside,
|
||||
.wp-editor-wrap .wp-editor-container .wp-editor-area,
|
||||
#nav-menu-theme-locations .howto select {
|
||||
width: 97.5%;
|
||||
}
|
||||
|
||||
/* without this dashboard widgets appear in one column for some screen widths */
|
||||
div#dashboard-widgets {
|
||||
padding-right: 0;
|
||||
padding-left: 1px;
|
||||
}
|
||||
|
||||
#dashboard_quick_press h4 {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.tagchecklist span a {
|
||||
margin: 4px -9px 0 0;
|
||||
}
|
||||
|
||||
.widefat th input {
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
|
||||
/* ---------- add by navid */
|
||||
#TB_window {
|
||||
width: 670px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-right: 335px !important;
|
||||
}
|
||||
|
||||
#dashboard_plugins {
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
#dashboard_plugins h3.hndle {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
#dashboard_incoming_links ul li,
|
||||
#dashboard_secondary ul li,
|
||||
#dashboard_primary ul li,
|
||||
p.row-actions {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#post-status-info {
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
p.submit { /* quick edit and reply in edit-comments.php */
|
||||
height:22px;
|
||||
}
|
||||
|
||||
form#widgets-filter { /* fix widget page */
|
||||
position: static;
|
||||
}
|
||||
|
||||
/* nav menus
|
||||
.menu-max-depth-0 #menu-management { width: 460px; }
|
||||
.menu-max-depth-1 #menu-management { width: 490px; }
|
||||
.menu-max-depth-2 #menu-management { width: 520px; }
|
||||
.menu-max-depth-3 #menu-management { width: 550px; }
|
||||
.menu-max-depth-4 #menu-management { width: 580px; }
|
||||
.menu-max-depth-5 #menu-management { width: 610px; }
|
||||
.menu-max-depth-6 #menu-management { width: 640px; }
|
||||
.menu-max-depth-7 #menu-management { width: 670px; }
|
||||
.menu-max-depth-8 #menu-management { width: 700px; }
|
||||
.menu-max-depth-9 #menu-management { width: 730px; }
|
||||
.menu-max-depth-10 #menu-management { width: 760px; }
|
||||
.menu-max-depth-11 #menu-management { width: 790px; }
|
||||
*/
|
||||
.menu-item-depth-0 { margin-left: 0px; }
|
||||
.menu-item-depth-1 { margin-left: -30px; }
|
||||
.menu-item-depth-2 { margin-left: -60px; }
|
||||
.menu-item-depth-3 { margin-left: -90px; }
|
||||
.menu-item-depth-4 { margin-left: -120px; }
|
||||
.menu-item-depth-5 { margin-left: -150px; }
|
||||
.menu-item-depth-6 { margin-left: -180px; }
|
||||
.menu-item-depth-7 { margin-left: -210px; }
|
||||
.menu-item-depth-8 { margin-left: -240px; }
|
||||
.menu-item-depth-9 { margin-left: -270px; }
|
||||
.menu-item-depth-10 { margin-left: -300px; }
|
||||
.menu-item-depth-11 { margin-left: -330px; }
|
||||
|
||||
/*
|
||||
#menu-to-edit li dl {
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.ui-sortable-helper .menu-item-transport {
|
||||
margin-top: 13px;
|
||||
}
|
||||
|
||||
.ui-sortable-helper .menu-item-transport .menu-item-transport {
|
||||
margin-top: 0;
|
||||
}
|
||||
*/
|
||||
|
||||
#menu-management,
|
||||
.nav-menus-php .menu-edit,
|
||||
#nav-menu-header .submitbox {
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.nav-menus-php label {
|
||||
max-width: 90% !important;
|
||||
}
|
||||
|
||||
p.button-controls,
|
||||
.nav-menus-php .tabs-panel {
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
.nav-menus-php .major-publishing-actions .publishing-action {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#wpbody #nav-menu-header label {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#nav-menu-header {
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
||||
#nav-menu-footer {
|
||||
margin-bottom: -20px;
|
||||
}
|
||||
|
||||
#update-nav-menu .publishing-action {
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
#nav-menus-frame #update-nav-menu .delete-action {
|
||||
margin-top: -25px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#menu-to-edit li {
|
||||
margin-top: -10px;
|
||||
margin-bottom: -10px;
|
||||
}
|
||||
|
||||
.sortable-placeholder {
|
||||
margin-top: 0 !important;
|
||||
margin-left: 0 !important;
|
||||
margin-bottom: 13px !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.auto-add-pages {
|
||||
clear: both;
|
||||
float: none;
|
||||
}
|
||||
|
||||
#nav-menus-frame .open-label span {
|
||||
float: none;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#nav-menus-frame .delete-action {
|
||||
float: none;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
body{direction:rtl;width:99.5%}.rtl #adminmenuback{left:auto;right:0;background-image:none}.rtl #adminmenuback,.rtl #adminmenuwrap{border-width:0 0 0 1px}#plupload-upload-ui{zoom:1}.post-com-count-wrapper a.post-com-count{float:none}#adminmenu .wp-submenu ul{width:99%}#adminmenu .wp-submenu .wp-submenu .wp-submenu,#adminmenu .wp-menu-open .wp-submenu .wp-submenu{border:1px solid #dfdfdf}.folded #adminmenu .wp-submenu{right:30px;top:-4px}#adminmenu .wp-submenu .wp-submenu-head{padding:6px 10px 6px 4px}#wpcontent #adminmenu .wp-submenu li.wp-submenu-head{padding:3px 10px 4px 4px}div.quicktags-toolbar input{min-width:0}.inline-edit-row fieldset label span.title{float:right}.inline-edit-row fieldset label span.input-text-wrap{margin-right:0}p.search-box{float:left}#bh{margin:7px 10px 0 0;float:left}.postbox div.inside,.wp-editor-wrap .wp-editor-container .wp-editor-area,#nav-menu-theme-locations .howto select{width:97.5%}div#dashboard-widgets{padding-right:0;padding-left:1px}#dashboard_quick_press h4{text-align:right}.tagchecklist span a{margin:4px -9px 0 0}.widefat th input{margin:0 5px 0 0}#TB_window{width:670px;position:absolute;top:50%;left:50%;margin-right:335px!important}#dashboard_plugins{direction:ltr}#dashboard_plugins h3.hndle{direction:rtl}#dashboard_incoming_links ul li,#dashboard_secondary ul li,#dashboard_primary ul li,p.row-actions{width:100%}#post-status-info{height:25px}p.submit{height:22px}form#widgets-filter{position:static}.menu-item-depth-0{margin-left:0}.menu-item-depth-1{margin-left:-30px}.menu-item-depth-2{margin-left:-60px}.menu-item-depth-3{margin-left:-90px}.menu-item-depth-4{margin-left:-120px}.menu-item-depth-5{margin-left:-150px}.menu-item-depth-6{margin-left:-180px}.menu-item-depth-7{margin-left:-210px}.menu-item-depth-8{margin-left:-240px}.menu-item-depth-9{margin-left:-270px}.menu-item-depth-10{margin-left:-300px}.menu-item-depth-11{margin-left:-330px}#menu-management,.nav-menus-php .menu-edit,#nav-menu-header .submitbox{zoom:1}.nav-menus-php label{max-width:90%!important}p.button-controls,.nav-menus-php .tabs-panel{max-width:90%}.nav-menus-php .major-publishing-actions .publishing-action{float:none}#wpbody #nav-menu-header label{float:none}#nav-menu-header{margin-top:-10px}#nav-menu-footer{margin-bottom:-20px}#update-nav-menu .publishing-action{max-width:200px}#nav-menus-frame #update-nav-menu .delete-action{margin-top:-25px;float:left}#menu-to-edit li{margin-top:-10px;margin-bottom:-10px}.sortable-placeholder{margin-top:0!important;margin-left:0!important;margin-bottom:13px!important;padding:0!important}.auto-add-pages{clear:both;float:none}#nav-menus-frame .open-label span{float:none;display:inline-block}#nav-menus-frame .delete-action{float:none}
|
File diff suppressed because one or more lines are too long
|
@ -1,560 +0,0 @@
|
|||
/* Fixes for IE 7 bugs */
|
||||
|
||||
.wp-editor-wrap .wp-editor-container textarea.wp-editor-area {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
#post-body.columns-2 #postbox-container-1 {
|
||||
padding-left: 19px;
|
||||
}
|
||||
|
||||
.welcome-panel .wp-badge {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.welcome-panel .welcome-panel-column {
|
||||
margin: 0 -25px 0 4%;
|
||||
}
|
||||
|
||||
#wp-fullscreen-title {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
#wp_mce_fullscreen_ifr {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
#wp-fullscreen-tagline {
|
||||
color: #888;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#adminmenushadow {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#adminmenuback {
|
||||
left: 0;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
#adminmenuwrap {
|
||||
position: static;
|
||||
}
|
||||
|
||||
#adminmenu {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#adminmenu li.wp-menu-separator,
|
||||
#adminmenu li.wp-menu-separator-last {
|
||||
font-size: 1px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
#adminmenu a.menu-top {
|
||||
border-bottom: 0 none;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
#adminmenu .separator {
|
||||
font-size: 1px;
|
||||
line-height: 1px;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.folded #adminmenu .wp-submenu ul {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#adminmenu li.menu-top {
|
||||
margin-bottom: -2px;
|
||||
}
|
||||
|
||||
#adminmenu .wp-menu-arrow {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu li.wp-submenu-head {
|
||||
padding: 6px 4px 7px 10px;
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
.js.folded #adminmenu .menu-top {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.js.folded #adminmenu li.menu-top {
|
||||
display: block;
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
ul#adminmenu {
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
#adminmenu li.menu-top a.menu-top {
|
||||
min-width: auto;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
#wpcontent #adminmenu .wp-submenu li {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#collapse-menu {
|
||||
line-height: 23px;
|
||||
}
|
||||
|
||||
#wpadminbar .ab-comments-icon {
|
||||
padding-top: 7px;
|
||||
}
|
||||
|
||||
table.fixed th,
|
||||
table.fixed td {
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
#wpbody-content input.button,
|
||||
#wpbody-content input.button-primary,
|
||||
#wpbody-content input.button-secondary,
|
||||
#wpbody-content input.button-highlighted {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
#dashboard-widgets #dashboard_quick_press form p.submit #publish {
|
||||
float: none;
|
||||
}
|
||||
|
||||
#dashboard-widgets h3 a {
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
#dashboard_browser_nag {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
#dashboard_browser_nag .browser-icon {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tablenav-pages .current-page {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#wpbody-content .postbox {
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
#wpbody-content .postbox h3 {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
.major-publishing-actions,
|
||||
.wp-submenu,
|
||||
.wp-submenu li,
|
||||
#template,
|
||||
#template div,
|
||||
#editcat,
|
||||
#addcat {
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
.wp-menu-arrow {
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.submitbox {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
/* Inline Editor */
|
||||
#wpbody-content .quick-edit-row-post .inline-edit-col-left {
|
||||
width: 39%;
|
||||
}
|
||||
|
||||
#wpbody-content .inline-edit-row-post .inline-edit-col-center {
|
||||
width: 19%;
|
||||
}
|
||||
|
||||
#wpbody-content .quick-edit-row-page .inline-edit-col-left {
|
||||
width: 49%;
|
||||
}
|
||||
|
||||
#wpbody-content .bulk-edit-row .inline-edit-col-left {
|
||||
width: 29%;
|
||||
}
|
||||
|
||||
.inline-edit-row p.submit {
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
.inline-edit-row fieldset label span.title {
|
||||
display: block;
|
||||
float: left;
|
||||
width: 5em;
|
||||
}
|
||||
|
||||
.inline-edit-row fieldset label span.input-text-wrap {
|
||||
margin-left: 0;
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input {
|
||||
line-height: 130%;
|
||||
}
|
||||
|
||||
#wpbody-content .inline-edit-row .input-text-wrap input {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input {
|
||||
width: 8em;
|
||||
}
|
||||
/* end Inline Editor */
|
||||
|
||||
#titlediv #title {
|
||||
width: 98%;
|
||||
}
|
||||
|
||||
a.button {
|
||||
line-height: 1.4em;
|
||||
margin: 1px;
|
||||
padding: 2px 6px;
|
||||
}
|
||||
|
||||
#screen-options-wrap {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item,
|
||||
#post-status-info,
|
||||
#wpwrap,
|
||||
#wrap,
|
||||
#postdivrich,
|
||||
#postdiv,
|
||||
#poststuff,
|
||||
.metabox-holder,
|
||||
#titlediv,
|
||||
#post-body,
|
||||
#editorcontainer,
|
||||
.tablenav,
|
||||
.widget-liquid-left,
|
||||
.widget-liquid-right,
|
||||
#widgets-left,
|
||||
.widgets-sortables,
|
||||
#dragHelper,
|
||||
.widget .widget-top,
|
||||
.widget-control-actions,
|
||||
.tagchecklist,
|
||||
#col-container,
|
||||
#col-left,
|
||||
#col-right,
|
||||
.fileedit-sub {
|
||||
display: block;
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
p.search-box {
|
||||
position: static;
|
||||
float: right;
|
||||
margin: -3px 0 4px;
|
||||
}
|
||||
|
||||
#widget-list .widget,
|
||||
.feature-filter .feature-group li {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.feature-filter .feature-group li input {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#editorcontainer #content {
|
||||
overflow: auto;
|
||||
margin: auto;
|
||||
width: 98%;
|
||||
}
|
||||
|
||||
form#template div {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wp-editor-container .quicktags-toolbar input {
|
||||
overflow: visible;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
#poststuff h2 {
|
||||
font-size: 1.6em;
|
||||
}
|
||||
|
||||
#bh {
|
||||
margin: 7px 10px 0 0;
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* without this dashboard widgets appear in one column for some screen widths */
|
||||
div#dashboard-widgets {
|
||||
padding-right: 1px;
|
||||
}
|
||||
|
||||
.tagchecklist span, .tagchecklist span a {
|
||||
display: inline-block;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tagchecklist span a {
|
||||
margin: 4px 0 0 -9px;
|
||||
}
|
||||
|
||||
.tablenav .button-secondary,
|
||||
.nav .button-secondary {
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.tablenav select {
|
||||
font-size: 13px;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.tablenav .actions select {
|
||||
width: 155px;
|
||||
}
|
||||
|
||||
table.ie-fixed {
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
.widefat tr, .widefat th {
|
||||
margin-bottom: 0;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.widefat th input {
|
||||
margin: 0 0 0 5px;
|
||||
}
|
||||
|
||||
.widefat .check-column {
|
||||
padding: 6px 0 2px;
|
||||
}
|
||||
|
||||
.widefat tbody th.check-column {
|
||||
padding: 4px 0 22px;
|
||||
}
|
||||
|
||||
.widefat {
|
||||
empty-cells: show;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.tablenav a.button-secondary {
|
||||
display: inline-block;
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
.inactive-sidebar .widgets-sortables {
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
#available-widgets .widget-holder {
|
||||
padding-bottom: 65px;
|
||||
}
|
||||
|
||||
#widgets-left .inactive {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.widget-liquid-right .widget,
|
||||
.inactive-sidebar .widget {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.inactive-sidebar .widget {
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#wpcontent .button-primary-disabled {
|
||||
color: #9FD0D5;
|
||||
background: #298CBA;
|
||||
}
|
||||
|
||||
#wpcontent #ajax-loading,
|
||||
#wpcontent .ajax-loading {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
#the-comment-list .unapproved tr,
|
||||
#the-comment-list .unapproved td {
|
||||
background-color: #ffffe0;
|
||||
}
|
||||
|
||||
.imgedit-submit {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#nav-menus-frame,
|
||||
#wpbody,
|
||||
.menu li {
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
#update-nav-menu #post-body {
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.menu li {
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.menu li.sortable-placeholder {
|
||||
min-width: 400px;
|
||||
}
|
||||
|
||||
.about-wrap img.element-screenshot {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section img,
|
||||
.about-wrap .feature-section .image-mask {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.about-wrap .feature-section.three-col img {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.available-theme {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.available-theme ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.about-wrap .three-col-images img {
|
||||
margin: 0 0.6% 10px;
|
||||
}
|
||||
|
||||
.about-wrap .three-col-images .last-feature,
|
||||
.about-wrap .three-col-images .first-feature {
|
||||
float: none;
|
||||
}
|
||||
|
||||
/* IE6 leftovers */
|
||||
* html .row-actions {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
* html div.widget-liquid-left,
|
||||
* html div.widget-liquid-right {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
* html #editorcontainer {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
* html #poststuff h2 {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
* html .stuffbox,
|
||||
* html .stuffbox input,
|
||||
* html .stuffbox textarea {
|
||||
border: 1px solid #DFDFDF;
|
||||
}
|
||||
|
||||
* html .feature-filter .feature-group li {
|
||||
width: 145px;
|
||||
}
|
||||
|
||||
* html div.widget-liquid-left {
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
* html .widgets-sortables {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
* html a#content_resize {
|
||||
right: -2px;
|
||||
}
|
||||
|
||||
* html .widget-title h4 {
|
||||
width: 205px;
|
||||
}
|
||||
|
||||
* html #removing-widget .in-widget-title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
* html .media-item .pinkynail {
|
||||
height: 32px;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
* html .describe .field input.text,
|
||||
* html .describe .field textarea {
|
||||
width: 440px;
|
||||
}
|
||||
|
||||
* html input {
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
* html .edit-box {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
* html .postbox-container .meta-box-sortables {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
* html #wpbody-content #screen-options-link-wrap {
|
||||
display: inline-block;
|
||||
width: 150px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
* html #wpbody-content #contextual-help-link-wrap {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
* html #adminmenu {
|
||||
margin-left: -80px;
|
||||
}
|
||||
|
||||
* html .folded #adminmenu {
|
||||
margin-left: -22px;
|
||||
}
|
||||
|
||||
* html #wpcontent #adminmenu li.menu-top {
|
||||
display: inline;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* html #footer {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* html #adminmenu div.wp-menu-image {
|
||||
height: 29px;
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -1 +1,281 @@
|
|||
html{background:#f9f9f9}body{background:#fff;color:#333;font-family:sans-serif;margin:2em auto;padding:1em 2em;-webkit-border-radius:3px;border-radius:3px;border:1px solid #dfdfdf;max-width:700px}a{color:#21759b;text-decoration:none}a:hover{color:#d54e21}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:30px 0 0 0;padding:0;padding-bottom:7px}h2{font-size:16px}p,li,dd,dt{padding-bottom:2px;font-size:14px;line-height:1.5}code,.code{font-size:14px}ul,ol,dl{padding:5px 5px 5px 22px}a img{border:0}abbr{border:0;font-variant:normal}#logo{margin:6px 0 14px 0;border-bottom:0;text-align:center}.step{margin:20px 0 15px}.step,th{text-align:left;padding:0}.submit input,.button,.button-secondary{font-family:sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-webkit-border-radius:15px;border-radius:15px;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background:#f2f2f2;background-image:-webkit-gradient(linear,left bottom,left top,from(#ededed),to(#fff));background-image:-webkit-linear-gradient(bottom,#ededed,#fff);background-image:-moz-linear-gradient(bottom,#ededed,#fff);background-image:-o-linear-gradient(bottom,#ededed,#fff);background-image:linear-gradient(to top,#ededed,#fff)}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666}.button:active,.submit input:active,.button-secondary:active{background:#eee;background-image:-webkit-gradient(linear,left top,left bottom,from(#ededed),to(#fff));background-image:-webkit-linear-gradient(top,#ededed,#fff);background-image:-moz-linear-gradient(top,#ededed,#fff);background-image:-o-linear-gradient(top,#ededed,#fff);background-image:linear-gradient(to bottom,#ededed,#fff)}textarea{border:1px solid #dfdfdf;-webkit-border-radius:3px;border-radius:3px;font-family:sans-serif;width:695px}.form-table{border-collapse:collapse;margin-top:1em;width:100%}.form-table td{margin-bottom:9px;padding:10px 20px 10px 0;border-bottom:8px solid #fff;font-size:14px;vertical-align:top}.form-table th{font-size:14px;text-align:left;padding:16px 20px 10px 0;border-bottom:8px solid #fff;width:140px;vertical-align:top}.form-table code{line-height:18px;font-size:14px}.form-table p{margin:4px 0 0 0;font-size:11px}.form-table input{line-height:20px;font-size:15px;padding:2px;border:1px #dfdfdf solid;-webkit-border-radius:3px;border-radius:3px;font-family:sans-serif}.form-table input[type=text],.form-table input[type=password]{width:206px}.form-table th p{font-weight:normal}.form-table.install-success td{vertical-align:middle;padding:16px 20px 10px 0}.form-table.install-success td p{margin:0;font-size:14px}.form-table.install-success td code{margin:0;font-size:18px}#error-page{margin-top:50px}#error-page p{font-size:14px;line-height:18px;margin:25px 0 20px}#error-page code,.code{font-family:Consolas,Monaco,monospace}#pass-strength-result{background-color:#eee;border-color:#ddd!important;border-style:solid;border-width:1px;margin:5px 5px 5px 0;padding:5px;text-align:center;width:200px;display:none}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important}.message{border:1px solid #e6db55;padding:.3em .6em;margin:5px 0 15px;background-color:#ffffe0}body.rtl{font-family:Tahoma,arial}.rtl h1{font-family:arial;margin:5px -4px 0 0}.rtl ul,.rtl ol{padding:5px 22px 5px 5px}.rtl .step,.rtl th,.rtl .form-table th{text-align:right}.rtl .submit input,.rtl .button,.rtl .button-secondary{margin-right:0}.rtl #dbname,.rtl #uname,.rtl #pwd,.rtl #dbhost,.rtl #prefix,.rtl #user_login,.rtl #admin_email,.rtl #pass1,.rtl #pass2{direction:ltr}
|
||||
html {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #fff;
|
||||
color: #333;
|
||||
font-family: sans-serif;
|
||||
margin: 2em auto;
|
||||
padding: 1em 2em;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #dfdfdf;
|
||||
max-width: 700px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #21759b;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #d54e21;
|
||||
}
|
||||
|
||||
h1 {
|
||||
border-bottom: 1px solid #dadada;
|
||||
clear: both;
|
||||
color: #666;
|
||||
font: 24px Georgia, "Times New Roman", Times, serif;
|
||||
margin: 30px 0 0 0;
|
||||
padding: 0;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
p, li, dd, dt {
|
||||
padding-bottom: 2px;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
code, .code {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
ul, ol, dl {
|
||||
padding: 5px 5px 5px 22px;
|
||||
}
|
||||
|
||||
a img {
|
||||
border:0
|
||||
}
|
||||
abbr {
|
||||
border: 0;
|
||||
font-variant: normal;
|
||||
}
|
||||
#logo {
|
||||
margin: 6px 0 14px 0;
|
||||
border-bottom: none;
|
||||
text-align:center
|
||||
}
|
||||
.step {
|
||||
margin: 20px 0 15px;
|
||||
}
|
||||
.step, th {
|
||||
text-align: left;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.submit input,
|
||||
.button,
|
||||
.button-secondary {
|
||||
font-family: sans-serif;
|
||||
text-decoration: none;
|
||||
font-size: 14px !important;
|
||||
line-height: 16px;
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #bbb;
|
||||
color: #464646;
|
||||
-webkit-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
background: #f2f2f2;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, from(#ededed), to(#fff));
|
||||
background-image: -webkit-linear-gradient(bottom, #ededed, #fff);
|
||||
background-image: -moz-linear-gradient(bottom, #ededed, #fff);
|
||||
background-image: -o-linear-gradient(bottom, #ededed, #fff);
|
||||
background-image: linear-gradient(to top, #ededed, #fff);
|
||||
}
|
||||
|
||||
.button:hover,
|
||||
.button-secondary:hover,
|
||||
.submit input:hover {
|
||||
color: #000;
|
||||
border-color: #666;
|
||||
}
|
||||
|
||||
.button:active,
|
||||
.submit input:active,
|
||||
.button-secondary:active {
|
||||
background: #eee;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
|
||||
background-image: -webkit-linear-gradient(top, #ededed, #fff);
|
||||
background-image: -moz-linear-gradient(top, #ededed, #fff);
|
||||
background-image: -o-linear-gradient(top, #ededed, #fff);
|
||||
background-image: linear-gradient(to bottom, #ededed, #fff);
|
||||
}
|
||||
|
||||
textarea {
|
||||
border: 1px solid #dfdfdf;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
font-family: sans-serif;
|
||||
width: 695px;
|
||||
}
|
||||
|
||||
.form-table {
|
||||
border-collapse: collapse;
|
||||
margin-top: 1em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.form-table td {
|
||||
margin-bottom: 9px;
|
||||
padding: 10px 20px 10px 0;
|
||||
border-bottom: 8px solid #fff;
|
||||
font-size: 14px;
|
||||
vertical-align: top
|
||||
}
|
||||
|
||||
.form-table th {
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
padding: 16px 20px 10px 0;
|
||||
border-bottom: 8px solid #fff;
|
||||
width: 140px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.form-table code {
|
||||
line-height: 18px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.form-table p {
|
||||
margin: 4px 0 0 0;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.form-table input {
|
||||
line-height: 20px;
|
||||
font-size: 15px;
|
||||
padding: 2px;
|
||||
border: 1px #dfdfdf solid;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
.form-table input[type=text],
|
||||
.form-table input[type=password] {
|
||||
width: 206px;
|
||||
}
|
||||
|
||||
.form-table th p {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.form-table.install-success td {
|
||||
vertical-align: middle;
|
||||
padding: 16px 20px 10px 0;
|
||||
}
|
||||
|
||||
.form-table.install-success td p {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.form-table.install-success td code {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#error-page {
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
#error-page p {
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
margin: 25px 0 20px;
|
||||
}
|
||||
|
||||
#error-page code, .code {
|
||||
font-family: Consolas, Monaco, monospace;
|
||||
}
|
||||
|
||||
#pass-strength-result {
|
||||
background-color: #eee;
|
||||
border-color: #ddd !important;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 5px 5px 5px 0;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
width: 200px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#pass-strength-result.bad {
|
||||
background-color: #ffb78c;
|
||||
border-color: #ff853c !important;
|
||||
}
|
||||
|
||||
#pass-strength-result.good {
|
||||
background-color: #ffec8b;
|
||||
border-color: #ffcc00 !important;
|
||||
}
|
||||
|
||||
#pass-strength-result.short {
|
||||
background-color: #ffa0a0;
|
||||
border-color: #f04040 !important;
|
||||
}
|
||||
|
||||
#pass-strength-result.strong {
|
||||
background-color: #c3ff88;
|
||||
border-color: #8dff1c !important;
|
||||
}
|
||||
|
||||
.message {
|
||||
border: 1px solid #e6db55;
|
||||
padding: 0.3em 0.6em;
|
||||
margin: 5px 0 15px;
|
||||
background-color: #ffffe0;
|
||||
}
|
||||
|
||||
/* install-rtl */
|
||||
body.rtl {
|
||||
font-family: Tahoma, arial;
|
||||
}
|
||||
|
||||
.rtl h1 {
|
||||
font-family: arial;
|
||||
margin: 5px -4px 0 0;
|
||||
}
|
||||
|
||||
.rtl ul,
|
||||
.rtl ol {
|
||||
padding: 5px 22px 5px 5px;
|
||||
}
|
||||
|
||||
.rtl .step,
|
||||
.rtl th,
|
||||
.rtl .form-table th {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.rtl .submit input,
|
||||
.rtl .button,
|
||||
.rtl .button-secondary {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.rtl #dbname,
|
||||
.rtl #uname,
|
||||
.rtl #pwd,
|
||||
.rtl #dbhost,
|
||||
.rtl #prefix,
|
||||
.rtl #user_login,
|
||||
.rtl #admin_email,
|
||||
.rtl #pass1,
|
||||
.rtl #pass2 {
|
||||
direction: ltr;
|
||||
}
|
||||
|
|
|
@ -1,281 +0,0 @@
|
|||
html {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #fff;
|
||||
color: #333;
|
||||
font-family: sans-serif;
|
||||
margin: 2em auto;
|
||||
padding: 1em 2em;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #dfdfdf;
|
||||
max-width: 700px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #21759b;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #d54e21;
|
||||
}
|
||||
|
||||
h1 {
|
||||
border-bottom: 1px solid #dadada;
|
||||
clear: both;
|
||||
color: #666;
|
||||
font: 24px Georgia, "Times New Roman", Times, serif;
|
||||
margin: 30px 0 0 0;
|
||||
padding: 0;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
p, li, dd, dt {
|
||||
padding-bottom: 2px;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
code, .code {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
ul, ol, dl {
|
||||
padding: 5px 5px 5px 22px;
|
||||
}
|
||||
|
||||
a img {
|
||||
border:0
|
||||
}
|
||||
abbr {
|
||||
border: 0;
|
||||
font-variant: normal;
|
||||
}
|
||||
#logo {
|
||||
margin: 6px 0 14px 0;
|
||||
border-bottom: none;
|
||||
text-align:center
|
||||
}
|
||||
.step {
|
||||
margin: 20px 0 15px;
|
||||
}
|
||||
.step, th {
|
||||
text-align: left;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.submit input,
|
||||
.button,
|
||||
.button-secondary {
|
||||
font-family: sans-serif;
|
||||
text-decoration: none;
|
||||
font-size: 14px !important;
|
||||
line-height: 16px;
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #bbb;
|
||||
color: #464646;
|
||||
-webkit-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
background: #f2f2f2;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, from(#ededed), to(#fff));
|
||||
background-image: -webkit-linear-gradient(bottom, #ededed, #fff);
|
||||
background-image: -moz-linear-gradient(bottom, #ededed, #fff);
|
||||
background-image: -o-linear-gradient(bottom, #ededed, #fff);
|
||||
background-image: linear-gradient(to top, #ededed, #fff);
|
||||
}
|
||||
|
||||
.button:hover,
|
||||
.button-secondary:hover,
|
||||
.submit input:hover {
|
||||
color: #000;
|
||||
border-color: #666;
|
||||
}
|
||||
|
||||
.button:active,
|
||||
.submit input:active,
|
||||
.button-secondary:active {
|
||||
background: #eee;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
|
||||
background-image: -webkit-linear-gradient(top, #ededed, #fff);
|
||||
background-image: -moz-linear-gradient(top, #ededed, #fff);
|
||||
background-image: -o-linear-gradient(top, #ededed, #fff);
|
||||
background-image: linear-gradient(to bottom, #ededed, #fff);
|
||||
}
|
||||
|
||||
textarea {
|
||||
border: 1px solid #dfdfdf;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
font-family: sans-serif;
|
||||
width: 695px;
|
||||
}
|
||||
|
||||
.form-table {
|
||||
border-collapse: collapse;
|
||||
margin-top: 1em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.form-table td {
|
||||
margin-bottom: 9px;
|
||||
padding: 10px 20px 10px 0;
|
||||
border-bottom: 8px solid #fff;
|
||||
font-size: 14px;
|
||||
vertical-align: top
|
||||
}
|
||||
|
||||
.form-table th {
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
padding: 16px 20px 10px 0;
|
||||
border-bottom: 8px solid #fff;
|
||||
width: 140px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.form-table code {
|
||||
line-height: 18px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.form-table p {
|
||||
margin: 4px 0 0 0;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.form-table input {
|
||||
line-height: 20px;
|
||||
font-size: 15px;
|
||||
padding: 2px;
|
||||
border: 1px #dfdfdf solid;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
.form-table input[type=text],
|
||||
.form-table input[type=password] {
|
||||
width: 206px;
|
||||
}
|
||||
|
||||
.form-table th p {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.form-table.install-success td {
|
||||
vertical-align: middle;
|
||||
padding: 16px 20px 10px 0;
|
||||
}
|
||||
|
||||
.form-table.install-success td p {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.form-table.install-success td code {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#error-page {
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
#error-page p {
|
||||
font-size: 14px;
|
||||
line-height: 18px;
|
||||
margin: 25px 0 20px;
|
||||
}
|
||||
|
||||
#error-page code, .code {
|
||||
font-family: Consolas, Monaco, monospace;
|
||||
}
|
||||
|
||||
#pass-strength-result {
|
||||
background-color: #eee;
|
||||
border-color: #ddd !important;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
margin: 5px 5px 5px 0;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
width: 200px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#pass-strength-result.bad {
|
||||
background-color: #ffb78c;
|
||||
border-color: #ff853c !important;
|
||||
}
|
||||
|
||||
#pass-strength-result.good {
|
||||
background-color: #ffec8b;
|
||||
border-color: #ffcc00 !important;
|
||||
}
|
||||
|
||||
#pass-strength-result.short {
|
||||
background-color: #ffa0a0;
|
||||
border-color: #f04040 !important;
|
||||
}
|
||||
|
||||
#pass-strength-result.strong {
|
||||
background-color: #c3ff88;
|
||||
border-color: #8dff1c !important;
|
||||
}
|
||||
|
||||
.message {
|
||||
border: 1px solid #e6db55;
|
||||
padding: 0.3em 0.6em;
|
||||
margin: 5px 0 15px;
|
||||
background-color: #ffffe0;
|
||||
}
|
||||
|
||||
/* install-rtl */
|
||||
body.rtl {
|
||||
font-family: Tahoma, arial;
|
||||
}
|
||||
|
||||
.rtl h1 {
|
||||
font-family: arial;
|
||||
margin: 5px -4px 0 0;
|
||||
}
|
||||
|
||||
.rtl ul,
|
||||
.rtl ol {
|
||||
padding: 5px 22px 5px 5px;
|
||||
}
|
||||
|
||||
.rtl .step,
|
||||
.rtl th,
|
||||
.rtl .form-table th {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.rtl .submit input,
|
||||
.rtl .button,
|
||||
.rtl .button-secondary {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.rtl #dbname,
|
||||
.rtl #uname,
|
||||
.rtl #pwd,
|
||||
.rtl #dbhost,
|
||||
.rtl #prefix,
|
||||
.rtl #user_login,
|
||||
.rtl #admin_email,
|
||||
.rtl #pass1,
|
||||
.rtl #pass2 {
|
||||
direction: ltr;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
html{background:#f9f9f9}body{background:#fff;color:#333;font-family:sans-serif;margin:2em auto;padding:1em 2em;-webkit-border-radius:3px;border-radius:3px;border:1px solid #dfdfdf;max-width:700px}a{color:#21759b;text-decoration:none}a:hover{color:#d54e21}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:30px 0 0 0;padding:0;padding-bottom:7px}h2{font-size:16px}p,li,dd,dt{padding-bottom:2px;font-size:14px;line-height:1.5}code,.code{font-size:14px}ul,ol,dl{padding:5px 5px 5px 22px}a img{border:0}abbr{border:0;font-variant:normal}#logo{margin:6px 0 14px 0;border-bottom:0;text-align:center}.step{margin:20px 0 15px}.step,th{text-align:left;padding:0}.submit input,.button,.button-secondary{font-family:sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-webkit-border-radius:15px;border-radius:15px;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;background:#f2f2f2;background-image:-webkit-gradient(linear,left bottom,left top,from(#ededed),to(#fff));background-image:-webkit-linear-gradient(bottom,#ededed,#fff);background-image:-moz-linear-gradient(bottom,#ededed,#fff);background-image:-o-linear-gradient(bottom,#ededed,#fff);background-image:linear-gradient(to top,#ededed,#fff)}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666}.button:active,.submit input:active,.button-secondary:active{background:#eee;background-image:-webkit-gradient(linear,left top,left bottom,from(#ededed),to(#fff));background-image:-webkit-linear-gradient(top,#ededed,#fff);background-image:-moz-linear-gradient(top,#ededed,#fff);background-image:-o-linear-gradient(top,#ededed,#fff);background-image:linear-gradient(to bottom,#ededed,#fff)}textarea{border:1px solid #dfdfdf;-webkit-border-radius:3px;border-radius:3px;font-family:sans-serif;width:695px}.form-table{border-collapse:collapse;margin-top:1em;width:100%}.form-table td{margin-bottom:9px;padding:10px 20px 10px 0;border-bottom:8px solid #fff;font-size:14px;vertical-align:top}.form-table th{font-size:14px;text-align:left;padding:16px 20px 10px 0;border-bottom:8px solid #fff;width:140px;vertical-align:top}.form-table code{line-height:18px;font-size:14px}.form-table p{margin:4px 0 0 0;font-size:11px}.form-table input{line-height:20px;font-size:15px;padding:2px;border:1px #dfdfdf solid;-webkit-border-radius:3px;border-radius:3px;font-family:sans-serif}.form-table input[type=text],.form-table input[type=password]{width:206px}.form-table th p{font-weight:normal}.form-table.install-success td{vertical-align:middle;padding:16px 20px 10px 0}.form-table.install-success td p{margin:0;font-size:14px}.form-table.install-success td code{margin:0;font-size:18px}#error-page{margin-top:50px}#error-page p{font-size:14px;line-height:18px;margin:25px 0 20px}#error-page code,.code{font-family:Consolas,Monaco,monospace}#pass-strength-result{background-color:#eee;border-color:#ddd!important;border-style:solid;border-width:1px;margin:5px 5px 5px 0;padding:5px;text-align:center;width:200px;display:none}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important}.message{border:1px solid #e6db55;padding:.3em .6em;margin:5px 0 15px;background-color:#ffffe0}body.rtl{font-family:Tahoma,arial}.rtl h1{font-family:arial;margin:5px -4px 0 0}.rtl ul,.rtl ol{padding:5px 22px 5px 5px}.rtl .step,.rtl th,.rtl .form-table th{text-align:right}.rtl .submit input,.rtl .button,.rtl .button-secondary{margin-right:0}.rtl #dbname,.rtl #uname,.rtl #pwd,.rtl #dbhost,.rtl #prefix,.rtl #user_login,.rtl #admin_email,.rtl #pass1,.rtl #pass2{direction:ltr}
|
|
@ -1 +1,71 @@
|
|||
body#media-upload ul#sidemenu{left:auto;right:0}#search-filter{text-align:left}.align .field label{padding:0 23px 0 0;margin:0 3px 0 1em}.image-align-none-label,.image-align-left-label,.image-align-center-label,.image-align-right-label{background-position:center right}tr.image-size label{margin:0 5px 0 0}.file-error{margin:0 50px 5px 0}.progress{left:auto;right:0}.describe td{padding:0 0 0 5px}#media-upload .describe th.label{text-align:right}.menu_order{float:left}.media-upload-form label.form-help,td.help,#media-upload p.help,#media-upload label.help{font-family:Tahoma,Arial}#gallery-settings #basic th.label{padding:5px 0 5px 5px}#gallery-settings .title,h3.media-title{font-family:Tahoma,Arial}#gallery-settings .describe th.label{text-align:right}#gallery-settings label,#gallery-settings legend{margin-right:0;margin-left:15px}#gallery-settings .align .field label{margin:0 3px 0 1em}#sort-buttons{margin:3px 0 -8px 25px;text-align:left}#sort-buttons #asc,#sort-buttons #showall{padding-left:0;padding-right:5px}#sort-buttons span{margin-right:0;margin-left:25px}
|
||||
body#media-upload ul#sidemenu {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
#search-filter {
|
||||
text-align: left;
|
||||
}
|
||||
/* specific to the image upload form */
|
||||
.align .field label {
|
||||
padding: 0 23px 0 0;
|
||||
margin: 0 3px 0 1em;
|
||||
}
|
||||
.image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label {
|
||||
background-position: center right;
|
||||
}
|
||||
tr.image-size label {
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
.file-error {
|
||||
margin: 0 50px 5px 0;
|
||||
}
|
||||
.progress {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
.describe td {
|
||||
padding: 0 0 0 5px;
|
||||
}
|
||||
|
||||
/* Specific to Uploader */
|
||||
#media-upload .describe th.label {
|
||||
text-align: right;
|
||||
}
|
||||
.menu_order {
|
||||
float: left;
|
||||
}
|
||||
.media-upload-form label.form-help, td.help, #media-upload p.help, #media-upload label.help {
|
||||
font-family: Tahoma, Arial;
|
||||
}
|
||||
#gallery-settings #basic th.label {
|
||||
padding: 5px 0 5px 5px;
|
||||
}
|
||||
#gallery-settings .title, h3.media-title {
|
||||
font-family: Tahoma, Arial;
|
||||
}
|
||||
#gallery-settings .describe th.label {
|
||||
text-align: right;
|
||||
}
|
||||
#gallery-settings label,
|
||||
#gallery-settings legend {
|
||||
margin-right: 0;
|
||||
margin-left: 15px;
|
||||
}
|
||||
#gallery-settings .align .field label {
|
||||
margin: 0 3px 0 1em;
|
||||
}
|
||||
#sort-buttons {
|
||||
margin: 3px 0 -8px 25px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#sort-buttons #asc,
|
||||
#sort-buttons #showall {
|
||||
padding-left: 0;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#sort-buttons span {
|
||||
margin-right: 0;
|
||||
margin-left: 25px;
|
||||
}
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
body#media-upload ul#sidemenu {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
#search-filter {
|
||||
text-align: left;
|
||||
}
|
||||
/* specific to the image upload form */
|
||||
.align .field label {
|
||||
padding: 0 23px 0 0;
|
||||
margin: 0 3px 0 1em;
|
||||
}
|
||||
.image-align-none-label, .image-align-left-label, .image-align-center-label, .image-align-right-label {
|
||||
background-position: center right;
|
||||
}
|
||||
tr.image-size label {
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
.file-error {
|
||||
margin: 0 50px 5px 0;
|
||||
}
|
||||
.progress {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
.describe td {
|
||||
padding: 0 0 0 5px;
|
||||
}
|
||||
|
||||
/* Specific to Uploader */
|
||||
#media-upload .describe th.label {
|
||||
text-align: right;
|
||||
}
|
||||
.menu_order {
|
||||
float: left;
|
||||
}
|
||||
.media-upload-form label.form-help, td.help, #media-upload p.help, #media-upload label.help {
|
||||
font-family: Tahoma, Arial;
|
||||
}
|
||||
#gallery-settings #basic th.label {
|
||||
padding: 5px 0 5px 5px;
|
||||
}
|
||||
#gallery-settings .title, h3.media-title {
|
||||
font-family: Tahoma, Arial;
|
||||
}
|
||||
#gallery-settings .describe th.label {
|
||||
text-align: right;
|
||||
}
|
||||
#gallery-settings label,
|
||||
#gallery-settings legend {
|
||||
margin-right: 0;
|
||||
margin-left: 15px;
|
||||
}
|
||||
#gallery-settings .align .field label {
|
||||
margin: 0 3px 0 1em;
|
||||
}
|
||||
#sort-buttons {
|
||||
margin: 3px 0 -8px 25px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#sort-buttons #asc,
|
||||
#sort-buttons #showall {
|
||||
padding-left: 0;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
#sort-buttons span {
|
||||
margin-right: 0;
|
||||
margin-left: 25px;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
body#media-upload ul#sidemenu{left:auto;right:0}#search-filter{text-align:left}.align .field label{padding:0 23px 0 0;margin:0 3px 0 1em}.image-align-none-label,.image-align-left-label,.image-align-center-label,.image-align-right-label{background-position:center right}tr.image-size label{margin:0 5px 0 0}.file-error{margin:0 50px 5px 0}.progress{left:auto;right:0}.describe td{padding:0 0 0 5px}#media-upload .describe th.label{text-align:right}.menu_order{float:left}.media-upload-form label.form-help,td.help,#media-upload p.help,#media-upload label.help{font-family:Tahoma,Arial}#gallery-settings #basic th.label{padding:5px 0 5px 5px}#gallery-settings .title,h3.media-title{font-family:Tahoma,Arial}#gallery-settings .describe th.label{text-align:right}#gallery-settings label,#gallery-settings legend{margin-right:0;margin-left:15px}#gallery-settings .align .field label{margin:0 3px 0 1em}#sort-buttons{margin:3px 0 -8px 25px;text-align:left}#sort-buttons #asc,#sort-buttons #showall{padding-left:0;padding-right:5px}#sort-buttons span{margin-right:0;margin-left:25px}
|
|
@ -1 +1,329 @@
|
|||
div#media-upload-header{margin:0;padding:5px 5px 0;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid}body#media-upload ul#sidemenu{font-weight:normal;margin:0 5px;left:0;bottom:-1px;float:none;overflow:hidden}form{margin:1em}#search-filter{text-align:right}th{position:relative}.media-upload-form label.form-help,td.help{font-family:sans-serif;font-style:italic;font-weight:normal}.media-upload-form p.help{margin:0;padding:0}.media-upload-form fieldset{width:100%;border:0;text-align:justify;margin:0 0 1em 0;padding:0}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left}tr.image-size td{width:460px}tr.image-size div.image-size-item{margin:0 0 5px}#library-form .progress,#gallery-form .progress,.insert-gallery,.describe.startopen,.describe.startclosed{display:none}.media-item .thumbnail{max-width:128px;max-height:128px}thead.media-item-info tr{background-color:transparent}.form-table thead.media-item-info{border:8px solid #fff}abbr.required{text-decoration:none;border:0}.describe label{display:inline}.describe td.error{padding:2px 8px}.describe td.A1{width:132px}.describe input[type="text"],.describe textarea{width:460px;border-width:1px;border-style:solid}#media-upload p.ml-submit{padding:1em 0}#media-upload p.help,#media-upload label.help{font-family:sans-serif;font-style:italic;font-weight:normal}#media-upload .ui-sortable .media-item{cursor:move}#media-upload tr.image-size{margin-bottom:1em;height:3em}#media-upload #filter{width:623px}#media-upload #filter .subsubsub{margin:8px 0}#filter .tablenav select{border-style:solid;border-width:1px;padding:2px;vertical-align:top;width:auto}#media-upload .del-attachment{display:none;margin:5px 0}.menu_order{float:right;font-size:11px;margin:10px 10px 0}.menu_order_input{border:1px solid #ddd;font-size:10px;padding:1px;width:23px}.ui-sortable-helper{background-color:#fff;border:1px solid #aaa;opacity:.6;filter:alpha(opacity=60)}#media-upload th.order-head{width:20%;text-align:center}#media-upload th.actions-head{width:25%;text-align:center}#media-upload a.wp-post-thumbnail{margin:0 20px}#media-items a.delete{display:block;float:right}#media-upload .widefat{width:626px;border-style:solid solid none}.sorthelper{height:37px;width:623px;display:block}#gallery-settings th.label{width:160px}#gallery-settings #basic th.label{padding:5px 5px 5px 0}#gallery-settings .title{clear:both;padding:0 0 3px;font-size:1.6em;border-bottom:1px solid #dadada}h3.media-title{font-size:1.6em}h4.media-sub-title{border-bottom:1px solid #dadada;font-size:1.3em;margin:12px;padding:0 0 3px}#gallery-settings .title,h3.media-title,h4.media-sub-title{font-family:Georgia,"Times New Roman",Times,serif;font-weight:normal;color:#5a5a5a}#gallery-settings .describe td{vertical-align:middle;height:3em}#gallery-settings .describe th.label{padding-top:.5em;text-align:left}#gallery-settings .describe{padding:5px;width:615px;clear:both;cursor:default}#gallery-settings .describe select{width:15em}#gallery-settings .describe select option,#gallery-settings .describe td{padding:0}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#464646;margin-right:15px}#gallery-settings .align .field label{margin:0 1em 0 3px}#gallery-settings p.ml-submit{border-top:1px solid #dfdfdf}#gallery-settings select#columns{width:6em}#sort-buttons{font-size:.8em;margin:3px 25px -8px 0;text-align:right;max-width:625px}#sort-buttons a{text-decoration:none}#sort-buttons #asc,#sort-buttons #showall{padding-left:5px}#sort-buttons span{margin-right:25px}p.media-types{margin:1em}tr.not-image{display:none}table.not-image tr.not-image{display:table-row}table.not-image tr.image-only{display:none}
|
||||
/* Styles for the media library iframe (not used on the Library screen) */
|
||||
|
||||
div#media-upload-header {
|
||||
margin: 0;
|
||||
padding: 5px 5px 0;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
|
||||
body#media-upload ul#sidemenu {
|
||||
font-weight: normal;
|
||||
margin: 0 5px;
|
||||
left: 0;
|
||||
bottom: -1px;
|
||||
float: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
form {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
#search-filter {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
th {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.media-upload-form label.form-help, td.help {
|
||||
font-family: sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.media-upload-form p.help {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.media-upload-form fieldset {
|
||||
width: 100%;
|
||||
border: none;
|
||||
text-align: justify;
|
||||
margin: 0 0 1em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* specific to the image upload form */
|
||||
|
||||
.image-align-none-label {
|
||||
background: url(../images/align-none.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-left-label {
|
||||
background: url(../images/align-left.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-center-label {
|
||||
background: url(../images/align-center.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-right-label {
|
||||
background: url(../images/align-right.png) no-repeat center left;
|
||||
}
|
||||
|
||||
tr.image-size td {
|
||||
width: 460px;
|
||||
}
|
||||
|
||||
tr.image-size div.image-size-item {
|
||||
margin: 0 0 5px;
|
||||
}
|
||||
|
||||
#library-form .progress,
|
||||
#gallery-form .progress,
|
||||
.insert-gallery,
|
||||
.describe.startopen,
|
||||
.describe.startclosed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.media-item .thumbnail {
|
||||
max-width: 128px;
|
||||
max-height: 128px;
|
||||
}
|
||||
|
||||
thead.media-item-info tr {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.form-table thead.media-item-info {
|
||||
border: 8px solid #fff;
|
||||
}
|
||||
|
||||
abbr.required {
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.describe label {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.describe td.error {
|
||||
padding: 2px 8px;
|
||||
}
|
||||
|
||||
.describe td.A1 {
|
||||
width: 132px;
|
||||
}
|
||||
|
||||
.describe input[type="text"],
|
||||
.describe textarea {
|
||||
width: 460px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
/* Specific to Uploader */
|
||||
|
||||
#media-upload p.ml-submit {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
#media-upload p.help,
|
||||
#media-upload label.help {
|
||||
font-family: sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#media-upload .ui-sortable .media-item {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
#media-upload tr.image-size {
|
||||
margin-bottom: 1em;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#media-upload #filter {
|
||||
width: 623px;
|
||||
}
|
||||
|
||||
#media-upload #filter .subsubsub {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
#filter .tablenav select {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 2px;
|
||||
vertical-align: top;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#media-upload .del-attachment {
|
||||
display: none;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.menu_order {
|
||||
float: right;
|
||||
font-size: 11px;
|
||||
margin: 10px 10px 0;
|
||||
}
|
||||
|
||||
.menu_order_input {
|
||||
border: 1px solid #ddd;
|
||||
font-size: 10px;
|
||||
padding: 1px;
|
||||
width: 23px;
|
||||
}
|
||||
|
||||
.ui-sortable-helper {
|
||||
background-color: #fff;
|
||||
border: 1px solid #aaa;
|
||||
opacity: 0.6;
|
||||
filter: alpha(opacity=60);
|
||||
}
|
||||
|
||||
#media-upload th.order-head {
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload th.actions-head {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload a.wp-post-thumbnail {
|
||||
margin: 0 20px;
|
||||
}
|
||||
|
||||
#media-items a.delete {
|
||||
display: block;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#media-upload .widefat {
|
||||
width: 626px;
|
||||
border-style: solid solid none;
|
||||
}
|
||||
|
||||
.sorthelper {
|
||||
height: 37px;
|
||||
width: 623px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#gallery-settings th.label {
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
#gallery-settings #basic th.label {
|
||||
padding: 5px 5px 5px 0;
|
||||
}
|
||||
|
||||
#gallery-settings .title {
|
||||
clear: both;
|
||||
padding: 0 0 3px;
|
||||
font-size: 1.6em;
|
||||
border-bottom: 1px solid #DADADA;
|
||||
}
|
||||
|
||||
h3.media-title {
|
||||
font-size: 1.6em;
|
||||
}
|
||||
|
||||
h4.media-sub-title {
|
||||
border-bottom: 1px solid #DADADA;
|
||||
font-size: 1.3em;
|
||||
margin: 12px;
|
||||
padding: 0 0 3px;
|
||||
}
|
||||
|
||||
#gallery-settings .title,
|
||||
h3.media-title,
|
||||
h4.media-sub-title {
|
||||
font-family: Georgia,"Times New Roman",Times,serif;
|
||||
font-weight: normal;
|
||||
color: #5A5A5A;
|
||||
}
|
||||
|
||||
#gallery-settings .describe td {
|
||||
vertical-align: middle;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#gallery-settings .describe th.label {
|
||||
padding-top: .5em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#gallery-settings .describe {
|
||||
padding: 5px;
|
||||
width: 615px;
|
||||
clear: both;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#gallery-settings .describe select {
|
||||
width: 15em;
|
||||
}
|
||||
|
||||
#gallery-settings .describe select option,
|
||||
#gallery-settings .describe td {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#gallery-settings label,
|
||||
#gallery-settings legend {
|
||||
font-size: 13px;
|
||||
color: #464646;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
#gallery-settings .align .field label {
|
||||
margin: 0 1em 0 3px;
|
||||
}
|
||||
|
||||
#gallery-settings p.ml-submit {
|
||||
border-top: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
#gallery-settings select#columns {
|
||||
width: 6em;
|
||||
}
|
||||
|
||||
#sort-buttons {
|
||||
font-size: 0.8em;
|
||||
margin: 3px 25px -8px 0;
|
||||
text-align: right;
|
||||
max-width: 625px;
|
||||
}
|
||||
|
||||
#sort-buttons a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#sort-buttons #asc,
|
||||
#sort-buttons #showall {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#sort-buttons span {
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
p.media-types {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
tr.not-image {
|
||||
display: none;
|
||||
}
|
||||
|
||||
table.not-image tr.not-image {
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
table.not-image tr.image-only {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -1,329 +0,0 @@
|
|||
/* Styles for the media library iframe (not used on the Library screen) */
|
||||
|
||||
div#media-upload-header {
|
||||
margin: 0;
|
||||
padding: 5px 5px 0;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
|
||||
body#media-upload ul#sidemenu {
|
||||
font-weight: normal;
|
||||
margin: 0 5px;
|
||||
left: 0;
|
||||
bottom: -1px;
|
||||
float: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
form {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
#search-filter {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
th {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.media-upload-form label.form-help, td.help {
|
||||
font-family: sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.media-upload-form p.help {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.media-upload-form fieldset {
|
||||
width: 100%;
|
||||
border: none;
|
||||
text-align: justify;
|
||||
margin: 0 0 1em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* specific to the image upload form */
|
||||
|
||||
.image-align-none-label {
|
||||
background: url(../images/align-none.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-left-label {
|
||||
background: url(../images/align-left.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-center-label {
|
||||
background: url(../images/align-center.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-right-label {
|
||||
background: url(../images/align-right.png) no-repeat center left;
|
||||
}
|
||||
|
||||
tr.image-size td {
|
||||
width: 460px;
|
||||
}
|
||||
|
||||
tr.image-size div.image-size-item {
|
||||
margin: 0 0 5px;
|
||||
}
|
||||
|
||||
#library-form .progress,
|
||||
#gallery-form .progress,
|
||||
.insert-gallery,
|
||||
.describe.startopen,
|
||||
.describe.startclosed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.media-item .thumbnail {
|
||||
max-width: 128px;
|
||||
max-height: 128px;
|
||||
}
|
||||
|
||||
thead.media-item-info tr {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.form-table thead.media-item-info {
|
||||
border: 8px solid #fff;
|
||||
}
|
||||
|
||||
abbr.required {
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.describe label {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.describe td.error {
|
||||
padding: 2px 8px;
|
||||
}
|
||||
|
||||
.describe td.A1 {
|
||||
width: 132px;
|
||||
}
|
||||
|
||||
.describe input[type="text"],
|
||||
.describe textarea {
|
||||
width: 460px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
/* Specific to Uploader */
|
||||
|
||||
#media-upload p.ml-submit {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
#media-upload p.help,
|
||||
#media-upload label.help {
|
||||
font-family: sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#media-upload .ui-sortable .media-item {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
#media-upload tr.image-size {
|
||||
margin-bottom: 1em;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#media-upload #filter {
|
||||
width: 623px;
|
||||
}
|
||||
|
||||
#media-upload #filter .subsubsub {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
#filter .tablenav select {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 2px;
|
||||
vertical-align: top;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#media-upload .del-attachment {
|
||||
display: none;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.menu_order {
|
||||
float: right;
|
||||
font-size: 11px;
|
||||
margin: 10px 10px 0;
|
||||
}
|
||||
|
||||
.menu_order_input {
|
||||
border: 1px solid #ddd;
|
||||
font-size: 10px;
|
||||
padding: 1px;
|
||||
width: 23px;
|
||||
}
|
||||
|
||||
.ui-sortable-helper {
|
||||
background-color: #fff;
|
||||
border: 1px solid #aaa;
|
||||
opacity: 0.6;
|
||||
filter: alpha(opacity=60);
|
||||
}
|
||||
|
||||
#media-upload th.order-head {
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload th.actions-head {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload a.wp-post-thumbnail {
|
||||
margin: 0 20px;
|
||||
}
|
||||
|
||||
#media-items a.delete {
|
||||
display: block;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#media-upload .widefat {
|
||||
width: 626px;
|
||||
border-style: solid solid none;
|
||||
}
|
||||
|
||||
.sorthelper {
|
||||
height: 37px;
|
||||
width: 623px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#gallery-settings th.label {
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
#gallery-settings #basic th.label {
|
||||
padding: 5px 5px 5px 0;
|
||||
}
|
||||
|
||||
#gallery-settings .title {
|
||||
clear: both;
|
||||
padding: 0 0 3px;
|
||||
font-size: 1.6em;
|
||||
border-bottom: 1px solid #DADADA;
|
||||
}
|
||||
|
||||
h3.media-title {
|
||||
font-size: 1.6em;
|
||||
}
|
||||
|
||||
h4.media-sub-title {
|
||||
border-bottom: 1px solid #DADADA;
|
||||
font-size: 1.3em;
|
||||
margin: 12px;
|
||||
padding: 0 0 3px;
|
||||
}
|
||||
|
||||
#gallery-settings .title,
|
||||
h3.media-title,
|
||||
h4.media-sub-title {
|
||||
font-family: Georgia,"Times New Roman",Times,serif;
|
||||
font-weight: normal;
|
||||
color: #5A5A5A;
|
||||
}
|
||||
|
||||
#gallery-settings .describe td {
|
||||
vertical-align: middle;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#gallery-settings .describe th.label {
|
||||
padding-top: .5em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#gallery-settings .describe {
|
||||
padding: 5px;
|
||||
width: 615px;
|
||||
clear: both;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#gallery-settings .describe select {
|
||||
width: 15em;
|
||||
}
|
||||
|
||||
#gallery-settings .describe select option,
|
||||
#gallery-settings .describe td {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#gallery-settings label,
|
||||
#gallery-settings legend {
|
||||
font-size: 13px;
|
||||
color: #464646;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
#gallery-settings .align .field label {
|
||||
margin: 0 1em 0 3px;
|
||||
}
|
||||
|
||||
#gallery-settings p.ml-submit {
|
||||
border-top: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
#gallery-settings select#columns {
|
||||
width: 6em;
|
||||
}
|
||||
|
||||
#sort-buttons {
|
||||
font-size: 0.8em;
|
||||
margin: 3px 25px -8px 0;
|
||||
text-align: right;
|
||||
max-width: 625px;
|
||||
}
|
||||
|
||||
#sort-buttons a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#sort-buttons #asc,
|
||||
#sort-buttons #showall {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#sort-buttons span {
|
||||
margin-right: 25px;
|
||||
}
|
||||
|
||||
p.media-types {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
tr.not-image {
|
||||
display: none;
|
||||
}
|
||||
|
||||
table.not-image tr.not-image {
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
table.not-image tr.image-only {
|
||||
display: none;
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
div#media-upload-header{margin:0;padding:5px 5px 0;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid}body#media-upload ul#sidemenu{font-weight:normal;margin:0 5px;left:0;bottom:-1px;float:none;overflow:hidden}form{margin:1em}#search-filter{text-align:right}th{position:relative}.media-upload-form label.form-help,td.help{font-family:sans-serif;font-style:italic;font-weight:normal}.media-upload-form p.help{margin:0;padding:0}.media-upload-form fieldset{width:100%;border:0;text-align:justify;margin:0 0 1em 0;padding:0}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left}tr.image-size td{width:460px}tr.image-size div.image-size-item{margin:0 0 5px}#library-form .progress,#gallery-form .progress,.insert-gallery,.describe.startopen,.describe.startclosed{display:none}.media-item .thumbnail{max-width:128px;max-height:128px}thead.media-item-info tr{background-color:transparent}.form-table thead.media-item-info{border:8px solid #fff}abbr.required{text-decoration:none;border:0}.describe label{display:inline}.describe td.error{padding:2px 8px}.describe td.A1{width:132px}.describe input[type="text"],.describe textarea{width:460px;border-width:1px;border-style:solid}#media-upload p.ml-submit{padding:1em 0}#media-upload p.help,#media-upload label.help{font-family:sans-serif;font-style:italic;font-weight:normal}#media-upload .ui-sortable .media-item{cursor:move}#media-upload tr.image-size{margin-bottom:1em;height:3em}#media-upload #filter{width:623px}#media-upload #filter .subsubsub{margin:8px 0}#filter .tablenav select{border-style:solid;border-width:1px;padding:2px;vertical-align:top;width:auto}#media-upload .del-attachment{display:none;margin:5px 0}.menu_order{float:right;font-size:11px;margin:10px 10px 0}.menu_order_input{border:1px solid #ddd;font-size:10px;padding:1px;width:23px}.ui-sortable-helper{background-color:#fff;border:1px solid #aaa;opacity:.6;filter:alpha(opacity=60)}#media-upload th.order-head{width:20%;text-align:center}#media-upload th.actions-head{width:25%;text-align:center}#media-upload a.wp-post-thumbnail{margin:0 20px}#media-items a.delete{display:block;float:right}#media-upload .widefat{width:626px;border-style:solid solid none}.sorthelper{height:37px;width:623px;display:block}#gallery-settings th.label{width:160px}#gallery-settings #basic th.label{padding:5px 5px 5px 0}#gallery-settings .title{clear:both;padding:0 0 3px;font-size:1.6em;border-bottom:1px solid #dadada}h3.media-title{font-size:1.6em}h4.media-sub-title{border-bottom:1px solid #dadada;font-size:1.3em;margin:12px;padding:0 0 3px}#gallery-settings .title,h3.media-title,h4.media-sub-title{font-family:Georgia,"Times New Roman",Times,serif;font-weight:normal;color:#5a5a5a}#gallery-settings .describe td{vertical-align:middle;height:3em}#gallery-settings .describe th.label{padding-top:.5em;text-align:left}#gallery-settings .describe{padding:5px;width:615px;clear:both;cursor:default}#gallery-settings .describe select{width:15em}#gallery-settings .describe select option,#gallery-settings .describe td{padding:0}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#464646;margin-right:15px}#gallery-settings .align .field label{margin:0 1em 0 3px}#gallery-settings p.ml-submit{border-top:1px solid #dfdfdf}#gallery-settings select#columns{width:6em}#sort-buttons{font-size:.8em;margin:3px 25px -8px 0;text-align:right;max-width:625px}#sort-buttons a{text-decoration:none}#sort-buttons #asc,#sort-buttons #showall{padding-left:5px}#sort-buttons span{margin-right:25px}p.media-types{margin:1em}tr.not-image{display:none}table.not-image tr.not-image{display:table-row}table.not-image tr.image-only{display:none}
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -1,5 +0,0 @@
|
|||
jQuery(document).ready( function($) {
|
||||
var myConfirm = function() { return '' !== $('#newcat').val(); };
|
||||
$('#jaxcat').prepend('<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" class="add:categorychecklist:jaxcat" id="catadd" value="' + catL10n.add + '"/><input type="hidden"/><input type="hidden"/><span id="howto">' + catL10n.how + '</span></span><span id="cat-ajax-response"></span>');
|
||||
$('#categorychecklist').wpList( { alt: '', response: 'cat-ajax-response', confirm: myConfirm } );
|
||||
} );
|
|
@ -1 +1,5 @@
|
|||
jQuery(document).ready(function(b){var a=function(){return""!==b("#newcat").val()};b("#jaxcat").prepend('<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" class="add:categorychecklist:jaxcat" id="catadd" value="'+catL10n.add+'"/><input type="hidden"/><input type="hidden"/><span id="howto">'+catL10n.how+'</span></span><span id="cat-ajax-response"></span>');b("#categorychecklist").wpList({alt:"",response:"cat-ajax-response",confirm:a})});
|
||||
jQuery(document).ready( function($) {
|
||||
var myConfirm = function() { return '' !== $('#newcat').val(); };
|
||||
$('#jaxcat').prepend('<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" class="add:categorychecklist:jaxcat" id="catadd" value="' + catL10n.add + '"/><input type="hidden"/><input type="hidden"/><span id="howto">' + catL10n.how + '</span></span><span id="cat-ajax-response"></span>');
|
||||
$('#categorychecklist').wpList( { alt: '', response: 'cat-ajax-response', confirm: myConfirm } );
|
||||
} );
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
jQuery(document).ready(function(b){var a=function(){return""!==b("#newcat").val()};b("#jaxcat").prepend('<span id="ajaxcat"><input type="text" name="newcat" id="newcat" size="16" autocomplete="off"/><input type="button" name="Button" class="add:categorychecklist:jaxcat" id="catadd" value="'+catL10n.add+'"/><input type="hidden"/><input type="hidden"/><span id="howto">'+catL10n.how+'</span></span><span id="cat-ajax-response"></span>');b("#categorychecklist").wpList({alt:"",response:"cat-ajax-response",confirm:a})});
|
|
@ -1,34 +0,0 @@
|
|||
jQuery(document).ready(function($) {
|
||||
var options = false, addAfter, delBefore, delAfter;
|
||||
if ( document.forms['addcat'].category_parent )
|
||||
options = document.forms['addcat'].category_parent.options;
|
||||
|
||||
addAfter = function( r, settings ) {
|
||||
var name, id;
|
||||
|
||||
name = $("<span>" + $('name', r).text() + "</span>").text();
|
||||
id = $('cat', r).attr('id');
|
||||
options[options.length] = new Option(name, id);
|
||||
}
|
||||
|
||||
delAfter = function( r, settings ) {
|
||||
var id = $('cat', r).attr('id'), o;
|
||||
for ( o = 0; o < options.length; o++ )
|
||||
if ( id == options[o].value )
|
||||
options[o] = null;
|
||||
}
|
||||
|
||||
delBefore = function(s) {
|
||||
if ( 'undefined' != showNotice )
|
||||
return showNotice.warn() ? s : false;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
if ( options )
|
||||
$('#the-list').wpList( { addAfter: addAfter, delBefore: delBefore, delAfter: delAfter } );
|
||||
else
|
||||
$('#the-list').wpList({ delBefore: delBefore });
|
||||
|
||||
$('.delete a[class^="delete"]').live('click', function(){return false;});
|
||||
});
|
|
@ -1 +1,34 @@
|
|||
jQuery(document).ready(function(d){var b=false,e,c,a;if(document.forms.addcat.category_parent){b=document.forms.addcat.category_parent.options}e=function(h,g){var f,i;f=d("<span>"+d("name",h).text()+"</span>").text();i=d("cat",h).attr("id");b[b.length]=new Option(f,i)};a=function(g,f){var i=d("cat",g).attr("id"),h;for(h=0;h<b.length;h++){if(i==b[h].value){b[h]=null}}};c=function(f){if("undefined"!=showNotice){return showNotice.warn()?f:false}return f};if(b){d("#the-list").wpList({addAfter:e,delBefore:c,delAfter:a})}else{d("#the-list").wpList({delBefore:c})}d('.delete a[class^="delete"]').live("click",function(){return false})});
|
||||
jQuery(document).ready(function($) {
|
||||
var options = false, addAfter, delBefore, delAfter;
|
||||
if ( document.forms['addcat'].category_parent )
|
||||
options = document.forms['addcat'].category_parent.options;
|
||||
|
||||
addAfter = function( r, settings ) {
|
||||
var name, id;
|
||||
|
||||
name = $("<span>" + $('name', r).text() + "</span>").text();
|
||||
id = $('cat', r).attr('id');
|
||||
options[options.length] = new Option(name, id);
|
||||
}
|
||||
|
||||
delAfter = function( r, settings ) {
|
||||
var id = $('cat', r).attr('id'), o;
|
||||
for ( o = 0; o < options.length; o++ )
|
||||
if ( id == options[o].value )
|
||||
options[o] = null;
|
||||
}
|
||||
|
||||
delBefore = function(s) {
|
||||
if ( 'undefined' != showNotice )
|
||||
return showNotice.warn() ? s : false;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
if ( options )
|
||||
$('#the-list').wpList( { addAfter: addAfter, delBefore: delBefore, delAfter: delAfter } );
|
||||
else
|
||||
$('#the-list').wpList({ delBefore: delBefore });
|
||||
|
||||
$('.delete a[class^="delete"]').live('click', function(){return false;});
|
||||
});
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
jQuery(document).ready(function(d){var b=false,e,c,a;if(document.forms.addcat.category_parent){b=document.forms.addcat.category_parent.options}e=function(h,g){var f,i;f=d("<span>"+d("name",h).text()+"</span>").text();i=d("cat",h).attr("id");b[b.length]=new Option(f,i)};a=function(g,f){var i=d("cat",g).attr("id"),h;for(h=0;h<b.length;h++){if(i==b[h].value){b[h]=null}}};c=function(f){if("undefined"!=showNotice){return showNotice.warn()?f:false}return f};if(b){d("#the-list").wpList({addAfter:e,delBefore:c,delAfter:a})}else{d("#the-list").wpList({delBefore:c})}d('.delete a[class^="delete"]').live("click",function(){return false})});
|
|
@ -1,47 +0,0 @@
|
|||
jQuery(document).ready( function($) {
|
||||
|
||||
var stamp = $('#timestamp').html();
|
||||
$('.edit-timestamp').click(function () {
|
||||
if ($('#timestampdiv').is(":hidden")) {
|
||||
$('#timestampdiv').slideDown("normal");
|
||||
$('.edit-timestamp').hide();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.cancel-timestamp').click(function() {
|
||||
$('#timestampdiv').slideUp("normal");
|
||||
$('#mm').val($('#hidden_mm').val());
|
||||
$('#jj').val($('#hidden_jj').val());
|
||||
$('#aa').val($('#hidden_aa').val());
|
||||
$('#hh').val($('#hidden_hh').val());
|
||||
$('#mn').val($('#hidden_mn').val());
|
||||
$('#timestamp').html(stamp);
|
||||
$('.edit-timestamp').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
|
||||
var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(),
|
||||
newD = new Date( aa, mm - 1, jj, hh, mn );
|
||||
|
||||
if ( newD.getFullYear() != aa || (1 + newD.getMonth()) != mm || newD.getDate() != jj || newD.getMinutes() != mn ) {
|
||||
$('.timestamp-wrap', '#timestampdiv').addClass('form-invalid');
|
||||
return false;
|
||||
} else {
|
||||
$('.timestamp-wrap', '#timestampdiv').removeClass('form-invalid');
|
||||
}
|
||||
|
||||
$('#timestampdiv').slideUp("normal");
|
||||
$('.edit-timestamp').show();
|
||||
$('#timestamp').html(
|
||||
commentL10n.submittedOn + ' <b>' +
|
||||
$( '#mm option[value="' + mm + '"]' ).text() + ' ' +
|
||||
jj + ', ' +
|
||||
aa + ' @ ' +
|
||||
hh + ':' +
|
||||
mn + '</b> '
|
||||
);
|
||||
return false;
|
||||
});
|
||||
});
|
|
@ -1 +1,47 @@
|
|||
jQuery(document).ready(function(b){var a=b("#timestamp").html();b(".edit-timestamp").click(function(){if(b("#timestampdiv").is(":hidden")){b("#timestampdiv").slideDown("normal");b(".edit-timestamp").hide()}return false});b(".cancel-timestamp").click(function(){b("#timestampdiv").slideUp("normal");b("#mm").val(b("#hidden_mm").val());b("#jj").val(b("#hidden_jj").val());b("#aa").val(b("#hidden_aa").val());b("#hh").val(b("#hidden_hh").val());b("#mn").val(b("#hidden_mn").val());b("#timestamp").html(a);b(".edit-timestamp").show();return false});b(".save-timestamp").click(function(){var g=b("#aa").val(),h=b("#mm").val(),d=b("#jj").val(),c=b("#hh").val(),f=b("#mn").val(),e=new Date(g,h-1,d,c,f);if(e.getFullYear()!=g||(1+e.getMonth())!=h||e.getDate()!=d||e.getMinutes()!=f){b(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{b(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}b("#timestampdiv").slideUp("normal");b(".edit-timestamp").show();b("#timestamp").html(commentL10n.submittedOn+" <b>"+b('#mm option[value="'+h+'"]').text()+" "+d+", "+g+" @ "+c+":"+f+"</b> ");return false})});
|
||||
jQuery(document).ready( function($) {
|
||||
|
||||
var stamp = $('#timestamp').html();
|
||||
$('.edit-timestamp').click(function () {
|
||||
if ($('#timestampdiv').is(":hidden")) {
|
||||
$('#timestampdiv').slideDown("normal");
|
||||
$('.edit-timestamp').hide();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.cancel-timestamp').click(function() {
|
||||
$('#timestampdiv').slideUp("normal");
|
||||
$('#mm').val($('#hidden_mm').val());
|
||||
$('#jj').val($('#hidden_jj').val());
|
||||
$('#aa').val($('#hidden_aa').val());
|
||||
$('#hh').val($('#hidden_hh').val());
|
||||
$('#mn').val($('#hidden_mn').val());
|
||||
$('#timestamp').html(stamp);
|
||||
$('.edit-timestamp').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels
|
||||
var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(),
|
||||
newD = new Date( aa, mm - 1, jj, hh, mn );
|
||||
|
||||
if ( newD.getFullYear() != aa || (1 + newD.getMonth()) != mm || newD.getDate() != jj || newD.getMinutes() != mn ) {
|
||||
$('.timestamp-wrap', '#timestampdiv').addClass('form-invalid');
|
||||
return false;
|
||||
} else {
|
||||
$('.timestamp-wrap', '#timestampdiv').removeClass('form-invalid');
|
||||
}
|
||||
|
||||
$('#timestampdiv').slideUp("normal");
|
||||
$('.edit-timestamp').show();
|
||||
$('#timestamp').html(
|
||||
commentL10n.submittedOn + ' <b>' +
|
||||
$( '#mm option[value="' + mm + '"]' ).text() + ' ' +
|
||||
jj + ', ' +
|
||||
aa + ' @ ' +
|
||||
hh + ':' +
|
||||
mn + '</b> '
|
||||
);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
jQuery(document).ready(function(b){var a=b("#timestamp").html();b(".edit-timestamp").click(function(){if(b("#timestampdiv").is(":hidden")){b("#timestampdiv").slideDown("normal");b(".edit-timestamp").hide()}return false});b(".cancel-timestamp").click(function(){b("#timestampdiv").slideUp("normal");b("#mm").val(b("#hidden_mm").val());b("#jj").val(b("#hidden_jj").val());b("#aa").val(b("#hidden_aa").val());b("#hh").val(b("#hidden_hh").val());b("#mn").val(b("#hidden_mn").val());b("#timestamp").html(a);b(".edit-timestamp").show();return false});b(".save-timestamp").click(function(){var g=b("#aa").val(),h=b("#mm").val(),d=b("#jj").val(),c=b("#hh").val(),f=b("#mn").val(),e=new Date(g,h-1,d,c,f);if(e.getFullYear()!=g||(1+e.getMonth())!=h||e.getDate()!=d||e.getMinutes()!=f){b(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{b(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}b("#timestampdiv").slideUp("normal");b(".edit-timestamp").show();b("#timestamp").html(commentL10n.submittedOn+" <b>"+b('#mm option[value="'+h+'"]').text()+" "+d+", "+g+" @ "+c+":"+f+"</b> ");return false})});
|
|
@ -1,385 +0,0 @@
|
|||
var showNotice, adminMenu, columns, validateForm, screenMeta;
|
||||
(function($){
|
||||
// Removed in 3.3.
|
||||
// (perhaps) needed for back-compat
|
||||
adminMenu = {
|
||||
init : function() {},
|
||||
fold : function() {},
|
||||
restoreMenuState : function() {},
|
||||
toggle : function() {},
|
||||
favorites : function() {}
|
||||
};
|
||||
|
||||
// show/hide/save table columns
|
||||
columns = {
|
||||
init : function() {
|
||||
var that = this;
|
||||
$('.hide-column-tog', '#adv-settings').click( function() {
|
||||
var $t = $(this), column = $t.val();
|
||||
if ( $t.prop('checked') )
|
||||
that.checked(column);
|
||||
else
|
||||
that.unchecked(column);
|
||||
|
||||
columns.saveManageColumnsState();
|
||||
});
|
||||
},
|
||||
|
||||
saveManageColumnsState : function() {
|
||||
var hidden = this.hidden();
|
||||
$.post(ajaxurl, {
|
||||
action: 'hidden-columns',
|
||||
hidden: hidden,
|
||||
screenoptionnonce: $('#screenoptionnonce').val(),
|
||||
page: pagenow
|
||||
});
|
||||
},
|
||||
|
||||
checked : function(column) {
|
||||
$('.column-' + column).show();
|
||||
this.colSpanChange(+1);
|
||||
},
|
||||
|
||||
unchecked : function(column) {
|
||||
$('.column-' + column).hide();
|
||||
this.colSpanChange(-1);
|
||||
},
|
||||
|
||||
hidden : function() {
|
||||
return $('.manage-column').filter(':hidden').map(function() { return this.id; }).get().join(',');
|
||||
},
|
||||
|
||||
useCheckboxesForHidden : function() {
|
||||
this.hidden = function(){
|
||||
return $('.hide-column-tog').not(':checked').map(function() {
|
||||
var id = this.id;
|
||||
return id.substring( id, id.length - 5 );
|
||||
}).get().join(',');
|
||||
};
|
||||
},
|
||||
|
||||
colSpanChange : function(diff) {
|
||||
var $t = $('table').find('.colspanchange'), n;
|
||||
if ( !$t.length )
|
||||
return;
|
||||
n = parseInt( $t.attr('colspan'), 10 ) + diff;
|
||||
$t.attr('colspan', n.toString());
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function(){columns.init();});
|
||||
|
||||
validateForm = function( form ) {
|
||||
return !$( form ).find('.form-required').filter( function() { return $('input:visible', this).val() == ''; } ).addClass( 'form-invalid' ).find('input:visible').change( function() { $(this).closest('.form-invalid').removeClass( 'form-invalid' ); } ).size();
|
||||
}
|
||||
|
||||
// stub for doing better warnings
|
||||
showNotice = {
|
||||
warn : function() {
|
||||
var msg = commonL10n.warnDelete || '';
|
||||
if ( confirm(msg) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
note : function(text) {
|
||||
alert(text);
|
||||
}
|
||||
};
|
||||
|
||||
screenMeta = {
|
||||
element: null, // #screen-meta
|
||||
toggles: null, // .screen-meta-toggle
|
||||
page: null, // #wpcontent
|
||||
|
||||
init: function() {
|
||||
this.element = $('#screen-meta');
|
||||
this.toggles = $('.screen-meta-toggle a');
|
||||
this.page = $('#wpcontent');
|
||||
|
||||
this.toggles.click( this.toggleEvent );
|
||||
},
|
||||
|
||||
toggleEvent: function( e ) {
|
||||
var panel = $( this.href.replace(/.+#/, '#') );
|
||||
e.preventDefault();
|
||||
|
||||
if ( !panel.length )
|
||||
return;
|
||||
|
||||
if ( panel.is(':visible') )
|
||||
screenMeta.close( panel, $(this) );
|
||||
else
|
||||
screenMeta.open( panel, $(this) );
|
||||
},
|
||||
|
||||
open: function( panel, link ) {
|
||||
|
||||
$('.screen-meta-toggle').not( link.parent() ).css('visibility', 'hidden');
|
||||
|
||||
panel.parent().show();
|
||||
panel.slideDown( 'fast', function() {
|
||||
panel.focus();
|
||||
link.addClass('screen-meta-active').attr('aria-expanded', true);
|
||||
});
|
||||
},
|
||||
|
||||
close: function( panel, link ) {
|
||||
panel.slideUp( 'fast', function() {
|
||||
link.removeClass('screen-meta-active').attr('aria-expanded', false);
|
||||
$('.screen-meta-toggle').css('visibility', '');
|
||||
panel.parent().hide();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Help tabs.
|
||||
*/
|
||||
$('.contextual-help-tabs').delegate('a', 'click focus', function(e) {
|
||||
var link = $(this),
|
||||
panel;
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
// Don't do anything if the click is for the tab already showing.
|
||||
if ( link.is('.active a') )
|
||||
return false;
|
||||
|
||||
// Links
|
||||
$('.contextual-help-tabs .active').removeClass('active');
|
||||
link.parent('li').addClass('active');
|
||||
|
||||
panel = $( link.attr('href') );
|
||||
|
||||
// Panels
|
||||
$('.help-tab-content').not( panel ).removeClass('active').hide();
|
||||
panel.addClass('active').show();
|
||||
});
|
||||
|
||||
$(document).ready( function() {
|
||||
var lastClicked = false, checks, first, last, checked, menu = $('#adminmenu'),
|
||||
pageInput = $('input.current-page'), currentPage = pageInput.val();
|
||||
|
||||
// when the menu is folded, make the fly-out submenu header clickable
|
||||
menu.on('click.wp-submenu-head', '.wp-submenu-head', function(e){
|
||||
$(e.target).parent().siblings('a').get(0).click();
|
||||
});
|
||||
|
||||
$('#collapse-menu').on('click.collapse-menu', function(e){
|
||||
var body = $(document.body);
|
||||
|
||||
// reset any compensation for submenus near the bottom of the screen
|
||||
$('#adminmenu div.wp-submenu').css('margin-top', '');
|
||||
|
||||
if ( $(window).width() < 900 ) {
|
||||
if ( body.hasClass('auto-fold') ) {
|
||||
body.removeClass('auto-fold');
|
||||
setUserSetting('unfold', 1);
|
||||
body.removeClass('folded');
|
||||
deleteUserSetting('mfold');
|
||||
} else {
|
||||
body.addClass('auto-fold');
|
||||
deleteUserSetting('unfold');
|
||||
}
|
||||
} else {
|
||||
if ( body.hasClass('folded') ) {
|
||||
body.removeClass('folded');
|
||||
deleteUserSetting('mfold');
|
||||
} else {
|
||||
body.addClass('folded');
|
||||
setUserSetting('mfold', 'f');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('li.wp-has-submenu', menu).hoverIntent({
|
||||
over: function(e){
|
||||
var b, h, o, f, m = $(this).find('.wp-submenu'), menutop, wintop, maxtop;
|
||||
|
||||
if ( parseInt( m.css('top'), 10 ) > -5 )
|
||||
return;
|
||||
|
||||
menutop = $(this).offset().top;
|
||||
wintop = $(window).scrollTop();
|
||||
maxtop = menutop - wintop - 30; // max = make the top of the sub almost touch admin bar
|
||||
|
||||
b = menutop + m.height() + 1; // Bottom offset of the menu
|
||||
h = $('#wpwrap').height(); // Height of the entire page
|
||||
o = 60 + b - h;
|
||||
f = $(window).height() + wintop - 15; // The fold
|
||||
|
||||
if ( f < (b - o) )
|
||||
o = b - f;
|
||||
|
||||
if ( o > maxtop )
|
||||
o = maxtop;
|
||||
|
||||
if ( o > 1 )
|
||||
m.css('margin-top', '-'+o+'px');
|
||||
else
|
||||
m.css('margin-top', '');
|
||||
|
||||
menu.find('li.menu-top').removeClass('opensub');
|
||||
$(this).addClass('opensub');
|
||||
},
|
||||
out: function(){
|
||||
$(this).removeClass('opensub').find('.wp-submenu').css('margin-top', '');
|
||||
},
|
||||
timeout: 200,
|
||||
sensitivity: 7,
|
||||
interval: 90
|
||||
});
|
||||
|
||||
menu.on('focus.adminmenu', '.wp-submenu a', function(e){
|
||||
$(e.target).closest('li.menu-top').addClass('opensub');
|
||||
}).on('blur.adminmenu', '.wp-submenu a', function(e){
|
||||
$(e.target).closest('li.menu-top').removeClass('opensub');
|
||||
});
|
||||
|
||||
// Move .updated and .error alert boxes. Don't move boxes designed to be inline.
|
||||
$('div.wrap h2:first').nextAll('div.updated, div.error').addClass('below-h2');
|
||||
$('div.updated, div.error').not('.below-h2, .inline').insertAfter( $('div.wrap h2:first') );
|
||||
|
||||
// Init screen meta
|
||||
screenMeta.init();
|
||||
|
||||
// check all checkboxes
|
||||
$('tbody').children().children('.check-column').find(':checkbox').click( function(e) {
|
||||
if ( 'undefined' == e.shiftKey ) { return true; }
|
||||
if ( e.shiftKey ) {
|
||||
if ( !lastClicked ) { return true; }
|
||||
checks = $( lastClicked ).closest( 'form' ).find( ':checkbox' );
|
||||
first = checks.index( lastClicked );
|
||||
last = checks.index( this );
|
||||
checked = $(this).prop('checked');
|
||||
if ( 0 < first && 0 < last && first != last ) {
|
||||
checks.slice( first, last ).prop( 'checked', function(){
|
||||
if ( $(this).closest('tr').is(':visible') )
|
||||
return checked;
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
lastClicked = this;
|
||||
|
||||
// toggle "check all" checkboxes
|
||||
var unchecked = $(this).closest('tbody').find(':checkbox').filter(':visible').not(':checked');
|
||||
$(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() {
|
||||
return ( 0 == unchecked.length );
|
||||
});
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
$('thead, tfoot').find('.check-column :checkbox').click( function(e) {
|
||||
var c = $(this).prop('checked'),
|
||||
kbtoggle = 'undefined' == typeof toggleWithKeyboard ? false : toggleWithKeyboard,
|
||||
toggle = e.shiftKey || kbtoggle;
|
||||
|
||||
$(this).closest( 'table' ).children( 'tbody' ).filter(':visible')
|
||||
.children().children('.check-column').find(':checkbox')
|
||||
.prop('checked', function() {
|
||||
if ( $(this).closest('tr').is(':hidden') )
|
||||
return false;
|
||||
if ( toggle )
|
||||
return $(this).prop( 'checked' );
|
||||
else if (c)
|
||||
return true;
|
||||
return false;
|
||||
});
|
||||
|
||||
$(this).closest('table').children('thead, tfoot').filter(':visible')
|
||||
.children().children('.check-column').find(':checkbox')
|
||||
.prop('checked', function() {
|
||||
if ( toggle )
|
||||
return false;
|
||||
else if (c)
|
||||
return true;
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
$('#default-password-nag-no').click( function() {
|
||||
setUserSetting('default_password_nag', 'hide');
|
||||
$('div.default-password-nag').hide();
|
||||
return false;
|
||||
});
|
||||
|
||||
// tab in textareas
|
||||
$('#newcontent').bind('keydown.wpevent_InsertTab', function(e) {
|
||||
var el = e.target, selStart, selEnd, val, scroll, sel;
|
||||
|
||||
if ( e.keyCode == 27 ) { // escape key
|
||||
$(el).data('tab-out', true);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( e.keyCode != 9 || e.ctrlKey || e.altKey || e.shiftKey ) // tab key
|
||||
return;
|
||||
|
||||
if ( $(el).data('tab-out') ) {
|
||||
$(el).data('tab-out', false);
|
||||
return;
|
||||
}
|
||||
|
||||
selStart = el.selectionStart;
|
||||
selEnd = el.selectionEnd;
|
||||
val = el.value;
|
||||
|
||||
try {
|
||||
this.lastKey = 9; // not a standard DOM property, lastKey is to help stop Opera tab event. See blur handler below.
|
||||
} catch(err) {}
|
||||
|
||||
if ( document.selection ) {
|
||||
el.focus();
|
||||
sel = document.selection.createRange();
|
||||
sel.text = '\t';
|
||||
} else if ( selStart >= 0 ) {
|
||||
scroll = this.scrollTop;
|
||||
el.value = val.substring(0, selStart).concat('\t', val.substring(selEnd) );
|
||||
el.selectionStart = el.selectionEnd = selStart + 1;
|
||||
this.scrollTop = scroll;
|
||||
}
|
||||
|
||||
if ( e.stopPropagation )
|
||||
e.stopPropagation();
|
||||
if ( e.preventDefault )
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$('#newcontent').bind('blur.wpevent_InsertTab', function(e) {
|
||||
if ( this.lastKey && 9 == this.lastKey )
|
||||
this.focus();
|
||||
});
|
||||
|
||||
if ( pageInput.length ) {
|
||||
pageInput.closest('form').submit( function(e){
|
||||
|
||||
// Reset paging var for new filters/searches but not for bulk actions. See #17685.
|
||||
if ( $('select[name="action"]').val() == -1 && $('select[name="action2"]').val() == -1 && pageInput.val() == currentPage )
|
||||
pageInput.val('1');
|
||||
});
|
||||
}
|
||||
|
||||
// Blur accessibility link background color onclick
|
||||
$(document).on('click.wp-accessibility-blur', 'a', function() {
|
||||
$(this).blur();
|
||||
});
|
||||
});
|
||||
|
||||
// internal use
|
||||
$(document).bind( 'wp_CloseOnEscape', function( e, data ) {
|
||||
if ( typeof(data.cb) != 'function' )
|
||||
return;
|
||||
|
||||
if ( typeof(data.condition) != 'function' || data.condition() )
|
||||
data.cb();
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,66 +0,0 @@
|
|||
var farbtastic, pickColor;
|
||||
|
||||
(function($) {
|
||||
|
||||
var defaultColor = '';
|
||||
|
||||
pickColor = function(color) {
|
||||
farbtastic.setColor(color);
|
||||
$('#background-color').val(color);
|
||||
$('#custom-background-image').css('background-color', color);
|
||||
// If we have a default color, and they match, then we need to hide the 'Default' link.
|
||||
// Otherwise, we hide the 'Clear' link when it is empty.
|
||||
if ( ( defaultColor && color === defaultColor ) || ( ! defaultColor && ( '' === color || '#' === color ) ) )
|
||||
$('#clearcolor').hide();
|
||||
else
|
||||
$('#clearcolor').show();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
defaultColor = $('#defaultcolor').val();
|
||||
|
||||
$('#pickcolor').click(function() {
|
||||
$('#colorPickerDiv').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#clearcolor a').click( function(e) {
|
||||
pickColor( defaultColor );
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$('#background-color').keyup(function() {
|
||||
var _hex = $('#background-color').val(), hex = _hex;
|
||||
if ( hex.charAt(0) != '#' )
|
||||
hex = '#' + hex;
|
||||
hex = hex.replace(/[^#a-fA-F0-9]+/, '');
|
||||
if ( hex != _hex )
|
||||
$('#background-color').val(hex);
|
||||
if ( hex.length == 4 || hex.length == 7 )
|
||||
pickColor( hex );
|
||||
});
|
||||
|
||||
$('input[name="background-position-x"]').change(function() {
|
||||
$('#custom-background-image').css('background-position', $(this).val() + ' top');
|
||||
});
|
||||
|
||||
$('input[name="background-repeat"]').change(function() {
|
||||
$('#custom-background-image').css('background-repeat', $(this).val());
|
||||
});
|
||||
|
||||
farbtastic = $.farbtastic('#colorPickerDiv', function(color) {
|
||||
pickColor(color);
|
||||
});
|
||||
pickColor($('#background-color').val());
|
||||
|
||||
$(document).mousedown(function(){
|
||||
$('#colorPickerDiv').each(function(){
|
||||
var display = $(this).css('display');
|
||||
if ( display == 'block' )
|
||||
$(this).fadeOut(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery);
|
|
@ -1 +1,66 @@
|
|||
var farbtastic,pickColor;(function(b){var a="";pickColor=function(c){farbtastic.setColor(c);b("#background-color").val(c);b("#custom-background-image").css("background-color",c);if((a&&c===a)||(!a&&(""===c||"#"===c))){b("#clearcolor").hide()}else{b("#clearcolor").show()}};b(document).ready(function(){a=b("#defaultcolor").val();b("#pickcolor").click(function(){b("#colorPickerDiv").show();return false});b("#clearcolor a").click(function(c){pickColor(a);c.preventDefault()});b("#background-color").keyup(function(){var d=b("#background-color").val(),c=d;if(c.charAt(0)!="#"){c="#"+c}c=c.replace(/[^#a-fA-F0-9]+/,"");if(c!=d){b("#background-color").val(c)}if(c.length==4||c.length==7){pickColor(c)}});b('input[name="background-position-x"]').change(function(){b("#custom-background-image").css("background-position",b(this).val()+" top")});b('input[name="background-repeat"]').change(function(){b("#custom-background-image").css("background-repeat",b(this).val())});farbtastic=b.farbtastic("#colorPickerDiv",function(c){pickColor(c)});pickColor(b("#background-color").val());b(document).mousedown(function(){b("#colorPickerDiv").each(function(){var c=b(this).css("display");if(c=="block"){b(this).fadeOut(2)}})})})})(jQuery);
|
||||
var farbtastic, pickColor;
|
||||
|
||||
(function($) {
|
||||
|
||||
var defaultColor = '';
|
||||
|
||||
pickColor = function(color) {
|
||||
farbtastic.setColor(color);
|
||||
$('#background-color').val(color);
|
||||
$('#custom-background-image').css('background-color', color);
|
||||
// If we have a default color, and they match, then we need to hide the 'Default' link.
|
||||
// Otherwise, we hide the 'Clear' link when it is empty.
|
||||
if ( ( defaultColor && color === defaultColor ) || ( ! defaultColor && ( '' === color || '#' === color ) ) )
|
||||
$('#clearcolor').hide();
|
||||
else
|
||||
$('#clearcolor').show();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
defaultColor = $('#defaultcolor').val();
|
||||
|
||||
$('#pickcolor').click(function() {
|
||||
$('#colorPickerDiv').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#clearcolor a').click( function(e) {
|
||||
pickColor( defaultColor );
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$('#background-color').keyup(function() {
|
||||
var _hex = $('#background-color').val(), hex = _hex;
|
||||
if ( hex.charAt(0) != '#' )
|
||||
hex = '#' + hex;
|
||||
hex = hex.replace(/[^#a-fA-F0-9]+/, '');
|
||||
if ( hex != _hex )
|
||||
$('#background-color').val(hex);
|
||||
if ( hex.length == 4 || hex.length == 7 )
|
||||
pickColor( hex );
|
||||
});
|
||||
|
||||
$('input[name="background-position-x"]').change(function() {
|
||||
$('#custom-background-image').css('background-position', $(this).val() + ' top');
|
||||
});
|
||||
|
||||
$('input[name="background-repeat"]').change(function() {
|
||||
$('#custom-background-image').css('background-repeat', $(this).val());
|
||||
});
|
||||
|
||||
farbtastic = $.farbtastic('#colorPickerDiv', function(color) {
|
||||
pickColor(color);
|
||||
});
|
||||
pickColor($('#background-color').val());
|
||||
|
||||
$(document).mousedown(function(){
|
||||
$('#colorPickerDiv').each(function(){
|
||||
var display = $(this).css('display');
|
||||
if ( display == 'block' )
|
||||
$(this).fadeOut(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery);
|
|
@ -0,0 +1 @@
|
|||
var farbtastic,pickColor;(function(b){var a="";pickColor=function(c){farbtastic.setColor(c);b("#background-color").val(c);b("#custom-background-image").css("background-color",c);if((a&&c===a)||(!a&&(""===c||"#"===c))){b("#clearcolor").hide()}else{b("#clearcolor").show()}};b(document).ready(function(){a=b("#defaultcolor").val();b("#pickcolor").click(function(){b("#colorPickerDiv").show();return false});b("#clearcolor a").click(function(c){pickColor(a);c.preventDefault()});b("#background-color").keyup(function(){var d=b("#background-color").val(),c=d;if(c.charAt(0)!="#"){c="#"+c}c=c.replace(/[^#a-fA-F0-9]+/,"");if(c!=d){b("#background-color").val(c)}if(c.length==4||c.length==7){pickColor(c)}});b('input[name="background-position-x"]').change(function(){b("#custom-background-image").css("background-position",b(this).val()+" top")});b('input[name="background-repeat"]').change(function(){b("#custom-background-image").css("background-repeat",b(this).val())});farbtastic=b.farbtastic("#colorPickerDiv",function(c){pickColor(c)});pickColor(b("#background-color").val());b(document).mousedown(function(){b("#colorPickerDiv").each(function(){var c=b(this).css("display");if(c=="block"){b(this).fadeOut(2)}})})})})(jQuery);
|
|
@ -1,34 +0,0 @@
|
|||
jQuery(document).ready( function($) {
|
||||
var before, addBefore, addAfter, delBefore;
|
||||
|
||||
before = function() {
|
||||
var nonce = $('#newmeta [name="_ajax_nonce"]').val(), postId = $('#post_ID').val();
|
||||
if ( !nonce || !postId ) { return false; }
|
||||
return [nonce,postId];
|
||||
}
|
||||
|
||||
addBefore = function( s ) {
|
||||
var b = before();
|
||||
if ( !b ) { return false; }
|
||||
s.data = s.data.replace(/_ajax_nonce=[a-f0-9]+/, '_ajax_nonce=' + b[0]) + '&post_id=' + b[1];
|
||||
return s;
|
||||
};
|
||||
|
||||
addAfter = function( r, s ) {
|
||||
var postId = $('postid', r).text(), h;
|
||||
if ( !postId ) { return; }
|
||||
$('#post_ID').attr( 'name', 'post_ID' ).val( postId );
|
||||
h = $('#hiddenaction');
|
||||
if ( 'post' == h.val() ) { h.val( 'postajaxpost' ); }
|
||||
};
|
||||
|
||||
delBefore = function( s ) {
|
||||
var b = before(); if ( !b ) return false;
|
||||
s.data._ajax_nonce = b[0]; s.data.post_id = b[1];
|
||||
return s;
|
||||
}
|
||||
|
||||
$('#the-list')
|
||||
.wpList( { addBefore: addBefore, addAfter: addAfter, delBefore: delBefore } )
|
||||
.find('.updatemeta, .deletemeta').attr( 'type', 'button' );
|
||||
} );
|
|
@ -1 +1,34 @@
|
|||
jQuery(document).ready(function(d){var c,b,e,a;c=function(){var g=d('#newmeta [name="_ajax_nonce"]').val(),f=d("#post_ID").val();if(!g||!f){return false}return[g,f]};b=function(g){var f=c();if(!f){return false}g.data=g.data.replace(/_ajax_nonce=[a-f0-9]+/,"_ajax_nonce="+f[0])+"&post_id="+f[1];return g};e=function(j,i){var f=d("postid",j).text(),g;if(!f){return}d("#post_ID").attr("name","post_ID").val(f);g=d("#hiddenaction");if("post"==g.val()){g.val("postajaxpost")}};a=function(g){var f=c();if(!f){return false}g.data._ajax_nonce=f[0];g.data.post_id=f[1];return g};d("#the-list").wpList({addBefore:b,addAfter:e,delBefore:a}).find(".updatemeta, .deletemeta").attr("type","button")});
|
||||
jQuery(document).ready( function($) {
|
||||
var before, addBefore, addAfter, delBefore;
|
||||
|
||||
before = function() {
|
||||
var nonce = $('#newmeta [name="_ajax_nonce"]').val(), postId = $('#post_ID').val();
|
||||
if ( !nonce || !postId ) { return false; }
|
||||
return [nonce,postId];
|
||||
}
|
||||
|
||||
addBefore = function( s ) {
|
||||
var b = before();
|
||||
if ( !b ) { return false; }
|
||||
s.data = s.data.replace(/_ajax_nonce=[a-f0-9]+/, '_ajax_nonce=' + b[0]) + '&post_id=' + b[1];
|
||||
return s;
|
||||
};
|
||||
|
||||
addAfter = function( r, s ) {
|
||||
var postId = $('postid', r).text(), h;
|
||||
if ( !postId ) { return; }
|
||||
$('#post_ID').attr( 'name', 'post_ID' ).val( postId );
|
||||
h = $('#hiddenaction');
|
||||
if ( 'post' == h.val() ) { h.val( 'postajaxpost' ); }
|
||||
};
|
||||
|
||||
delBefore = function( s ) {
|
||||
var b = before(); if ( !b ) return false;
|
||||
s.data._ajax_nonce = b[0]; s.data.post_id = b[1];
|
||||
return s;
|
||||
}
|
||||
|
||||
$('#the-list')
|
||||
.wpList( { addBefore: addBefore, addAfter: addAfter, delBefore: delBefore } )
|
||||
.find('.updatemeta, .deletemeta').attr( 'type', 'button' );
|
||||
} );
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
jQuery(document).ready(function(d){var c,b,e,a;c=function(){var g=d('#newmeta [name="_ajax_nonce"]').val(),f=d("#post_ID").val();if(!g||!f){return false}return[g,f]};b=function(g){var f=c();if(!f){return false}g.data=g.data.replace(/_ajax_nonce=[a-f0-9]+/,"_ajax_nonce="+f[0])+"&post_id="+f[1];return g};e=function(j,i){var f=d("postid",j).text(),g;if(!f){return}d("#post_ID").attr("name","post_ID").val(f);g=d("#hiddenaction");if("post"==g.val()){g.val("postajaxpost")}};a=function(g){var f=c();if(!f){return false}g.data._ajax_nonce=f[0];g.data.post_id=f[1];return g};d("#the-list").wpList({addBefore:b,addAfter:e,delBefore:a}).find(".updatemeta, .deletemeta").attr("type","button")});
|
|
@ -1,963 +0,0 @@
|
|||
(function( exports, $ ){
|
||||
var api = wp.customize;
|
||||
|
||||
/*
|
||||
* @param options
|
||||
* - previewer - The Previewer instance to sync with.
|
||||
* - transport - The transport to use for previewing. Supports 'refresh' and 'postMessage'.
|
||||
*/
|
||||
api.Setting = api.Value.extend({
|
||||
initialize: function( id, value, options ) {
|
||||
var element;
|
||||
|
||||
api.Value.prototype.initialize.call( this, value, options );
|
||||
|
||||
this.id = id;
|
||||
this.transport = this.transport || 'refresh';
|
||||
|
||||
this.bind( this.preview );
|
||||
},
|
||||
preview: function() {
|
||||
switch ( this.transport ) {
|
||||
case 'refresh':
|
||||
return this.previewer.refresh();
|
||||
case 'postMessage':
|
||||
return this.previewer.send( 'setting', [ this.id, this() ] );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
api.Control = api.Class.extend({
|
||||
initialize: function( id, options ) {
|
||||
var control = this,
|
||||
nodes, radios, settings;
|
||||
|
||||
this.params = {};
|
||||
$.extend( this, options || {} );
|
||||
|
||||
this.id = id;
|
||||
this.selector = '#customize-control-' + id.replace( ']', '' ).replace( '[', '-' );
|
||||
this.container = $( this.selector );
|
||||
|
||||
settings = $.map( this.params.settings, function( value ) {
|
||||
return value;
|
||||
});
|
||||
|
||||
api.apply( api, settings.concat( function() {
|
||||
var key;
|
||||
|
||||
control.settings = {};
|
||||
for ( key in control.params.settings ) {
|
||||
control.settings[ key ] = api( control.params.settings[ key ] );
|
||||
}
|
||||
|
||||
control.setting = control.settings['default'] || null;
|
||||
control.ready();
|
||||
}) );
|
||||
|
||||
control.elements = [];
|
||||
|
||||
nodes = this.container.find('[data-customize-setting-link]');
|
||||
radios = {};
|
||||
|
||||
nodes.each( function() {
|
||||
var node = $(this),
|
||||
name;
|
||||
|
||||
if ( node.is(':radio') ) {
|
||||
name = node.prop('name');
|
||||
if ( radios[ name ] )
|
||||
return;
|
||||
|
||||
radios[ name ] = true;
|
||||
node = nodes.filter( '[name="' + name + '"]' );
|
||||
}
|
||||
|
||||
api( node.data('customizeSettingLink'), function( setting ) {
|
||||
var element = new api.Element( node );
|
||||
control.elements.push( element );
|
||||
element.sync( setting );
|
||||
element.set( setting() );
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
ready: function() {},
|
||||
|
||||
dropdownInit: function() {
|
||||
var control = this,
|
||||
statuses = this.container.find('.dropdown-status'),
|
||||
params = this.params,
|
||||
update = function( to ) {
|
||||
if ( typeof to === 'string' && params.statuses && params.statuses[ to ] )
|
||||
statuses.html( params.statuses[ to ] ).show();
|
||||
else
|
||||
statuses.hide();
|
||||
};
|
||||
|
||||
// Support the .dropdown class to open/close complex elements
|
||||
this.container.on( 'click', '.dropdown', function( event ) {
|
||||
event.preventDefault();
|
||||
control.container.toggleClass('open');
|
||||
});
|
||||
|
||||
this.setting.bind( update );
|
||||
update( this.setting() );
|
||||
}
|
||||
});
|
||||
|
||||
api.ColorControl = api.Control.extend({
|
||||
ready: function() {
|
||||
var control = this,
|
||||
rhex, spot, input, text, update;
|
||||
|
||||
rhex = /^#([A-Fa-f0-9]{3}){0,2}$/;
|
||||
spot = this.container.find('.dropdown-content');
|
||||
input = new api.Element( this.container.find('.color-picker-hex') );
|
||||
update = function( color ) {
|
||||
spot.css( 'background', color );
|
||||
control.farbtastic.setColor( color );
|
||||
};
|
||||
|
||||
this.farbtastic = $.farbtastic( this.container.find('.farbtastic-placeholder'), control.setting.set );
|
||||
|
||||
// Only pass through values that are valid hexes/empty.
|
||||
input.sync( this.setting ).validate = function( to ) {
|
||||
return rhex.test( to ) ? to : null;
|
||||
};
|
||||
|
||||
this.setting.bind( update );
|
||||
update( this.setting() );
|
||||
|
||||
this.dropdownInit();
|
||||
}
|
||||
});
|
||||
|
||||
api.UploadControl = api.Control.extend({
|
||||
ready: function() {
|
||||
var control = this;
|
||||
|
||||
this.params.removed = this.params.removed || '';
|
||||
|
||||
this.success = $.proxy( this.success, this );
|
||||
|
||||
this.uploader = $.extend({
|
||||
container: this.container,
|
||||
browser: this.container.find('.upload'),
|
||||
dropzone: this.container.find('.upload-dropzone'),
|
||||
success: this.success
|
||||
}, this.uploader || {} );
|
||||
|
||||
if ( this.uploader.supported ) {
|
||||
if ( control.params.context )
|
||||
control.uploader.param( 'post_data[context]', this.params.context );
|
||||
|
||||
control.uploader.param( 'post_data[theme]', api.settings.theme.stylesheet );
|
||||
}
|
||||
|
||||
this.uploader = new wp.Uploader( this.uploader );
|
||||
|
||||
this.remover = this.container.find('.remove');
|
||||
this.remover.click( function( event ) {
|
||||
control.setting.set( control.params.removed );
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.removerVisibility = $.proxy( this.removerVisibility, this );
|
||||
this.setting.bind( this.removerVisibility );
|
||||
this.removerVisibility( this.setting.get() );
|
||||
},
|
||||
success: function( attachment ) {
|
||||
this.setting.set( attachment.url );
|
||||
},
|
||||
removerVisibility: function( to ) {
|
||||
this.remover.toggle( to != this.params.removed );
|
||||
}
|
||||
});
|
||||
|
||||
api.ImageControl = api.UploadControl.extend({
|
||||
ready: function() {
|
||||
var control = this,
|
||||
panels;
|
||||
|
||||
this.uploader = {
|
||||
init: function( up ) {
|
||||
var fallback, button;
|
||||
|
||||
if ( this.supports.dragdrop )
|
||||
return;
|
||||
|
||||
// Maintain references while wrapping the fallback button.
|
||||
fallback = control.container.find( '.upload-fallback' );
|
||||
button = fallback.children().detach();
|
||||
|
||||
this.browser.detach().empty().append( button );
|
||||
fallback.append( this.browser ).show();
|
||||
}
|
||||
};
|
||||
|
||||
api.UploadControl.prototype.ready.call( this );
|
||||
|
||||
this.thumbnail = this.container.find('.preview-thumbnail img');
|
||||
this.thumbnailSrc = $.proxy( this.thumbnailSrc, this );
|
||||
this.setting.bind( this.thumbnailSrc );
|
||||
|
||||
this.library = this.container.find('.library');
|
||||
|
||||
// Generate tab objects
|
||||
this.tabs = {};
|
||||
panels = this.library.find('.library-content');
|
||||
|
||||
this.library.children('ul').children('li').each( function() {
|
||||
var link = $(this),
|
||||
id = link.data('customizeTab'),
|
||||
panel = panels.filter('[data-customize-tab="' + id + '"]');
|
||||
|
||||
control.tabs[ id ] = {
|
||||
both: link.add( panel ),
|
||||
link: link,
|
||||
panel: panel
|
||||
};
|
||||
});
|
||||
|
||||
// Bind tab switch events
|
||||
this.library.children('ul').on( 'click', 'li', function( event ) {
|
||||
var id = $(this).data('customizeTab'),
|
||||
tab = control.tabs[ id ];
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
if ( tab.link.hasClass('library-selected') )
|
||||
return;
|
||||
|
||||
control.selected.both.removeClass('library-selected');
|
||||
control.selected = tab;
|
||||
control.selected.both.addClass('library-selected');
|
||||
});
|
||||
|
||||
// Bind events to switch image urls.
|
||||
this.library.on( 'click', 'a', function( event ) {
|
||||
var value = $(this).data('customizeImageValue');
|
||||
|
||||
if ( value ) {
|
||||
control.setting.set( value );
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
if ( this.tabs.uploaded ) {
|
||||
this.tabs.uploaded.target = this.library.find('.uploaded-target');
|
||||
if ( ! this.tabs.uploaded.panel.find('.thumbnail').length )
|
||||
this.tabs.uploaded.both.addClass('hidden');
|
||||
}
|
||||
|
||||
// Select a tab
|
||||
panels.each( function() {
|
||||
var tab = control.tabs[ $(this).data('customizeTab') ];
|
||||
|
||||
// Select the first visible tab.
|
||||
if ( ! tab.link.hasClass('hidden') ) {
|
||||
control.selected = tab;
|
||||
tab.both.addClass('library-selected');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
this.dropdownInit();
|
||||
},
|
||||
success: function( attachment ) {
|
||||
api.UploadControl.prototype.success.call( this, attachment );
|
||||
|
||||
// Add the uploaded image to the uploaded tab.
|
||||
if ( this.tabs.uploaded && this.tabs.uploaded.target.length ) {
|
||||
this.tabs.uploaded.both.removeClass('hidden');
|
||||
|
||||
attachment.element = $( '<a href="#" class="thumbnail"></a>' )
|
||||
.data( 'customizeImageValue', attachment.url )
|
||||
.append( '<img src="' + attachment.url+ '" />' )
|
||||
.appendTo( this.tabs.uploaded.target );
|
||||
}
|
||||
},
|
||||
thumbnailSrc: function( to ) {
|
||||
if ( /^(https?:)?\/\//.test( to ) )
|
||||
this.thumbnail.prop( 'src', to ).show();
|
||||
else
|
||||
this.thumbnail.hide();
|
||||
}
|
||||
});
|
||||
|
||||
// Change objects contained within the main customize object to Settings.
|
||||
api.defaultConstructor = api.Setting;
|
||||
|
||||
// Create the collection of Control objects.
|
||||
api.control = new api.Values({ defaultConstructor: api.Control });
|
||||
|
||||
api.PreviewFrame = api.Messenger.extend({
|
||||
sensitivity: 2000,
|
||||
|
||||
initialize: function( params, options ) {
|
||||
var deferred = $.Deferred(),
|
||||
self = this;
|
||||
|
||||
// This is the promise object.
|
||||
deferred.promise( this );
|
||||
|
||||
this.container = params.container;
|
||||
this.signature = params.signature;
|
||||
|
||||
$.extend( params, { channel: api.PreviewFrame.uuid() });
|
||||
|
||||
api.Messenger.prototype.initialize.call( this, params, options );
|
||||
|
||||
this.add( 'previewUrl', params.previewUrl );
|
||||
|
||||
this.query = $.extend( params.query || {}, { customize_messenger_channel: this.channel() });
|
||||
|
||||
this.run( deferred );
|
||||
},
|
||||
|
||||
run: function( deferred ) {
|
||||
var self = this,
|
||||
loaded = false,
|
||||
ready = false;
|
||||
|
||||
if ( this._ready )
|
||||
this.unbind( 'ready', this._ready );
|
||||
|
||||
this._ready = function() {
|
||||
ready = true;
|
||||
|
||||
if ( loaded )
|
||||
deferred.resolveWith( self );
|
||||
};
|
||||
|
||||
this.bind( 'ready', this._ready );
|
||||
|
||||
this.request = $.ajax( this.previewUrl(), {
|
||||
type: 'POST',
|
||||
data: this.query,
|
||||
xhrFields: {
|
||||
withCredentials: true
|
||||
}
|
||||
} );
|
||||
|
||||
this.request.fail( function() {
|
||||
deferred.rejectWith( self, [ 'request failure' ] );
|
||||
});
|
||||
|
||||
this.request.done( function( response ) {
|
||||
var location = self.request.getResponseHeader('Location'),
|
||||
signature = self.signature,
|
||||
index;
|
||||
|
||||
// Check if the location response header differs from the current URL.
|
||||
// If so, the request was redirected; try loading the requested page.
|
||||
if ( location && location != self.previewUrl() ) {
|
||||
deferred.rejectWith( self, [ 'redirect', location ] );
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the user is not logged in.
|
||||
if ( '0' === response ) {
|
||||
self.login( deferred );
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for cheaters.
|
||||
if ( '-1' === response ) {
|
||||
deferred.rejectWith( self, [ 'cheatin' ] );
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for a signature in the request.
|
||||
index = response.lastIndexOf( signature );
|
||||
if ( -1 === index || index < response.lastIndexOf('</html>') ) {
|
||||
deferred.rejectWith( self, [ 'unsigned' ] );
|
||||
return;
|
||||
}
|
||||
|
||||
// Strip the signature from the request.
|
||||
response = response.slice( 0, index ) + response.slice( index + signature.length );
|
||||
|
||||
// Create the iframe and inject the html content.
|
||||
self.iframe = $('<iframe />').appendTo( self.container );
|
||||
|
||||
// Bind load event after the iframe has been added to the page;
|
||||
// otherwise it will fire when injected into the DOM.
|
||||
self.iframe.one( 'load', function() {
|
||||
loaded = true;
|
||||
|
||||
if ( ready ) {
|
||||
deferred.resolveWith( self );
|
||||
} else {
|
||||
setTimeout( function() {
|
||||
deferred.rejectWith( self, [ 'ready timeout' ] );
|
||||
}, self.sensitivity );
|
||||
}
|
||||
});
|
||||
|
||||
self.targetWindow( self.iframe[0].contentWindow );
|
||||
|
||||
self.targetWindow().document.open();
|
||||
self.targetWindow().document.write( response );
|
||||
self.targetWindow().document.close();
|
||||
});
|
||||
},
|
||||
|
||||
login: function( deferred ) {
|
||||
var self = this,
|
||||
reject;
|
||||
|
||||
reject = function() {
|
||||
deferred.rejectWith( self, [ 'logged out' ] );
|
||||
};
|
||||
|
||||
if ( this.triedLogin )
|
||||
return reject();
|
||||
|
||||
// Check if we have an admin cookie.
|
||||
$.get( api.settings.url.ajax, {
|
||||
action: 'logged-in'
|
||||
}).fail( reject ).done( function( response ) {
|
||||
var iframe;
|
||||
|
||||
if ( '1' !== response )
|
||||
reject();
|
||||
|
||||
iframe = $('<iframe src="' + self.previewUrl() + '" />').hide();
|
||||
iframe.appendTo( self.container );
|
||||
iframe.load( function() {
|
||||
self.triedLogin = true;
|
||||
|
||||
iframe.remove();
|
||||
self.run( deferred );
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
api.Messenger.prototype.destroy.call( this );
|
||||
this.request.abort();
|
||||
|
||||
if ( this.iframe )
|
||||
this.iframe.remove();
|
||||
|
||||
delete this.request;
|
||||
delete this.iframe;
|
||||
delete this.targetWindow;
|
||||
}
|
||||
});
|
||||
|
||||
(function(){
|
||||
var uuid = 0;
|
||||
api.PreviewFrame.uuid = function() {
|
||||
return 'preview-' + uuid++;
|
||||
};
|
||||
}());
|
||||
|
||||
api.Previewer = api.Messenger.extend({
|
||||
refreshBuffer: 250,
|
||||
|
||||
/**
|
||||
* Requires params:
|
||||
* - container - a selector or jQuery element
|
||||
* - previewUrl - the URL of preview frame
|
||||
*/
|
||||
initialize: function( params, options ) {
|
||||
var self = this,
|
||||
rscheme = /^https?/,
|
||||
url;
|
||||
|
||||
$.extend( this, options || {} );
|
||||
|
||||
/*
|
||||
* Wrap this.refresh to prevent it from hammering the servers:
|
||||
*
|
||||
* If refresh is called once and no other refresh requests are
|
||||
* loading, trigger the request immediately.
|
||||
*
|
||||
* If refresh is called while another refresh request is loading,
|
||||
* debounce the refresh requests:
|
||||
* 1. Stop the loading request (as it is instantly outdated).
|
||||
* 2. Trigger the new request once refresh hasn't been called for
|
||||
* self.refreshBuffer milliseconds.
|
||||
*/
|
||||
this.refresh = (function( self ) {
|
||||
var refresh = self.refresh,
|
||||
callback = function() {
|
||||
timeout = null;
|
||||
refresh.call( self );
|
||||
},
|
||||
timeout;
|
||||
|
||||
return function() {
|
||||
if ( typeof timeout !== 'number' ) {
|
||||
if ( self.loading ) {
|
||||
self.abort();
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
}
|
||||
|
||||
clearTimeout( timeout );
|
||||
timeout = setTimeout( callback, self.refreshBuffer );
|
||||
};
|
||||
})( this );
|
||||
|
||||
this.container = api.ensure( params.container );
|
||||
this.allowedUrls = params.allowedUrls;
|
||||
this.signature = params.signature;
|
||||
|
||||
params.url = window.location.href;
|
||||
|
||||
api.Messenger.prototype.initialize.call( this, params );
|
||||
|
||||
this.add( 'scheme', this.origin() ).link( this.origin ).setter( function( to ) {
|
||||
var match = to.match( rscheme );
|
||||
return match ? match[0] : '';
|
||||
});
|
||||
|
||||
// Limit the URL to internal, front-end links.
|
||||
//
|
||||
// If the frontend and the admin are served from the same domain, load the
|
||||
// preview over ssl if the customizer is being loaded over ssl. This avoids
|
||||
// insecure content warnings. This is not attempted if the admin and frontend
|
||||
// are on different domains to avoid the case where the frontend doesn't have
|
||||
// ssl certs.
|
||||
|
||||
this.add( 'previewUrl', params.previewUrl ).setter( function( to ) {
|
||||
var result;
|
||||
|
||||
// Check for URLs that include "/wp-admin/" or end in "/wp-admin".
|
||||
// Strip hashes and query strings before testing.
|
||||
if ( /\/wp-admin(\/|$)/.test( to.replace(/[#?].*$/, '') ) )
|
||||
return null;
|
||||
|
||||
// Attempt to match the URL to the control frame's scheme
|
||||
// and check if it's allowed. If not, try the original URL.
|
||||
$.each([ to.replace( rscheme, self.scheme() ), to ], function( i, url ) {
|
||||
$.each( self.allowedUrls, function( i, allowed ) {
|
||||
if ( 0 === url.indexOf( allowed ) ) {
|
||||
result = url;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if ( result )
|
||||
return false;
|
||||
});
|
||||
|
||||
// If we found a matching result, return it. If not, bail.
|
||||
return result ? result : null;
|
||||
});
|
||||
|
||||
// Refresh the preview when the URL is changed (but not yet).
|
||||
this.previewUrl.bind( this.refresh );
|
||||
|
||||
this.scroll = 0;
|
||||
this.bind( 'scroll', function( distance ) {
|
||||
this.scroll = distance;
|
||||
});
|
||||
|
||||
// Update the URL when the iframe sends a URL message.
|
||||
this.bind( 'url', this.previewUrl );
|
||||
},
|
||||
|
||||
query: function() {},
|
||||
|
||||
abort: function() {
|
||||
if ( this.loading ) {
|
||||
this.loading.destroy();
|
||||
delete this.loading;
|
||||
}
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
var self = this;
|
||||
|
||||
this.abort();
|
||||
|
||||
this.loading = new api.PreviewFrame({
|
||||
url: this.url(),
|
||||
previewUrl: this.previewUrl(),
|
||||
query: this.query() || {},
|
||||
container: this.container,
|
||||
signature: this.signature
|
||||
});
|
||||
|
||||
this.loading.done( function() {
|
||||
// 'this' is the loading frame
|
||||
this.bind( 'synced', function() {
|
||||
if ( self.preview )
|
||||
self.preview.destroy();
|
||||
self.preview = this;
|
||||
delete self.loading;
|
||||
|
||||
self.targetWindow( this.targetWindow() );
|
||||
self.channel( this.channel() );
|
||||
|
||||
self.send( 'active' );
|
||||
});
|
||||
|
||||
this.send( 'sync', {
|
||||
scroll: self.scroll,
|
||||
settings: api.get()
|
||||
});
|
||||
});
|
||||
|
||||
this.loading.fail( function( reason, location ) {
|
||||
if ( 'redirect' === reason && location )
|
||||
self.previewUrl( location );
|
||||
|
||||
if ( 'logged out' === reason ) {
|
||||
if ( self.preview ) {
|
||||
self.preview.destroy();
|
||||
delete self.preview;
|
||||
}
|
||||
|
||||
self.login().done( self.refresh );
|
||||
}
|
||||
|
||||
if ( 'cheatin' === reason )
|
||||
self.cheatin();
|
||||
});
|
||||
},
|
||||
|
||||
login: function() {
|
||||
var previewer = this,
|
||||
deferred, messenger, iframe;
|
||||
|
||||
if ( this._login )
|
||||
return this._login;
|
||||
|
||||
deferred = $.Deferred();
|
||||
this._login = deferred.promise();
|
||||
|
||||
messenger = new api.Messenger({
|
||||
channel: 'login',
|
||||
url: api.settings.url.login
|
||||
});
|
||||
|
||||
iframe = $('<iframe src="' + api.settings.url.login + '" />').appendTo( this.container );
|
||||
|
||||
messenger.targetWindow( iframe[0].contentWindow );
|
||||
|
||||
messenger.bind( 'login', function() {
|
||||
iframe.remove();
|
||||
messenger.destroy();
|
||||
delete previewer._login;
|
||||
deferred.resolve();
|
||||
});
|
||||
|
||||
return this._login;
|
||||
},
|
||||
|
||||
cheatin: function() {
|
||||
$( document.body ).empty().addClass('cheatin').append( '<p>' + api.l10n.cheatin + '</p>' );
|
||||
}
|
||||
});
|
||||
|
||||
/* =====================================================================
|
||||
* Ready.
|
||||
* ===================================================================== */
|
||||
|
||||
api.controlConstructor = {
|
||||
color: api.ColorControl,
|
||||
upload: api.UploadControl,
|
||||
image: api.ImageControl
|
||||
};
|
||||
|
||||
$( function() {
|
||||
api.settings = window._wpCustomizeSettings;
|
||||
api.l10n = window._wpCustomizeControlsL10n;
|
||||
|
||||
// Check if we can run the customizer.
|
||||
if ( ! api.settings )
|
||||
return;
|
||||
|
||||
// Redirect to the fallback preview if any incompatibilities are found.
|
||||
if ( ! $.support.postMessage || ( ! $.support.cors && api.settings.isCrossDomain ) )
|
||||
return window.location = api.settings.url.fallback;
|
||||
|
||||
var body = $( document.body ),
|
||||
overlay = body.children('.wp-full-overlay'),
|
||||
query, previewer, parent;
|
||||
|
||||
// Prevent the form from saving when enter is pressed.
|
||||
$('#customize-controls').on( 'keydown', function( e ) {
|
||||
if ( $( e.target ).is('textarea') )
|
||||
return;
|
||||
|
||||
if ( 13 === e.which ) // Enter
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Initialize Previewer
|
||||
previewer = new api.Previewer({
|
||||
container: '#customize-preview',
|
||||
form: '#customize-controls',
|
||||
previewUrl: api.settings.url.preview,
|
||||
allowedUrls: api.settings.url.allowed,
|
||||
signature: 'WP_CUSTOMIZER_SIGNATURE'
|
||||
}, {
|
||||
|
||||
nonce: api.settings.nonce,
|
||||
|
||||
query: function() {
|
||||
return {
|
||||
wp_customize: 'on',
|
||||
theme: api.settings.theme.stylesheet,
|
||||
customized: JSON.stringify( api.get() ),
|
||||
nonce: this.nonce.preview
|
||||
};
|
||||
},
|
||||
|
||||
save: function() {
|
||||
var self = this,
|
||||
query = $.extend( this.query(), {
|
||||
action: 'customize_save',
|
||||
nonce: this.nonce.save
|
||||
}),
|
||||
request = $.post( api.settings.url.ajax, query );
|
||||
|
||||
api.trigger( 'save', request );
|
||||
|
||||
body.addClass('saving');
|
||||
|
||||
request.always( function() {
|
||||
body.removeClass('saving');
|
||||
});
|
||||
|
||||
request.done( function( response ) {
|
||||
// Check if the user is logged out.
|
||||
if ( '0' === response ) {
|
||||
self.preview.iframe.hide();
|
||||
self.login().done( function() {
|
||||
self.save();
|
||||
self.preview.iframe.show();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for cheaters.
|
||||
if ( '-1' === response ) {
|
||||
self.cheatin();
|
||||
return;
|
||||
}
|
||||
|
||||
api.trigger( 'saved' );
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Refresh the nonces if the preview sends updated nonces over.
|
||||
previewer.bind( 'nonce', function( nonce ) {
|
||||
$.extend( this.nonce, nonce );
|
||||
});
|
||||
|
||||
$.each( api.settings.settings, function( id, data ) {
|
||||
api.create( id, id, data.value, {
|
||||
transport: data.transport,
|
||||
previewer: previewer
|
||||
} );
|
||||
});
|
||||
|
||||
$.each( api.settings.controls, function( id, data ) {
|
||||
var constructor = api.controlConstructor[ data.type ] || api.Control,
|
||||
control;
|
||||
|
||||
control = api.control.add( id, new constructor( id, {
|
||||
params: data,
|
||||
previewer: previewer
|
||||
} ) );
|
||||
});
|
||||
|
||||
// Check if preview url is valid and load the preview frame.
|
||||
if ( previewer.previewUrl() )
|
||||
previewer.refresh();
|
||||
else
|
||||
previewer.previewUrl( api.settings.url.home );
|
||||
|
||||
// Save and activated states
|
||||
(function() {
|
||||
var state = new api.Values(),
|
||||
saved = state.create('saved'),
|
||||
activated = state.create('activated');
|
||||
|
||||
state.bind( 'change', function() {
|
||||
var save = $('#save'),
|
||||
back = $('.back');
|
||||
|
||||
if ( ! activated() ) {
|
||||
save.val( api.l10n.activate ).prop( 'disabled', false );
|
||||
back.text( api.l10n.cancel );
|
||||
|
||||
} else if ( saved() ) {
|
||||
save.val( api.l10n.saved ).prop( 'disabled', true );
|
||||
back.text( api.l10n.close );
|
||||
|
||||
} else {
|
||||
save.val( api.l10n.save ).prop( 'disabled', false );
|
||||
back.text( api.l10n.cancel );
|
||||
}
|
||||
});
|
||||
|
||||
// Set default states.
|
||||
saved( true );
|
||||
activated( api.settings.theme.active );
|
||||
|
||||
api.bind( 'change', function() {
|
||||
state('saved').set( false );
|
||||
});
|
||||
|
||||
api.bind( 'saved', function() {
|
||||
state('saved').set( true );
|
||||
state('activated').set( true );
|
||||
});
|
||||
|
||||
activated.bind( function( to ) {
|
||||
if ( to )
|
||||
api.trigger( 'activated' );
|
||||
});
|
||||
|
||||
// Expose states to the API.
|
||||
api.state = state;
|
||||
}());
|
||||
|
||||
// Temporary accordion code.
|
||||
$('.customize-section-title').click( function( event ) {
|
||||
var clicked = $( this ).parents( '.customize-section' );
|
||||
|
||||
if ( clicked.hasClass('cannot-expand') )
|
||||
return;
|
||||
|
||||
$( '.customize-section' ).not( clicked ).removeClass( 'open' );
|
||||
clicked.toggleClass( 'open' );
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
// Button bindings.
|
||||
$('#save').click( function( event ) {
|
||||
previewer.save();
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
$('.collapse-sidebar').click( function( event ) {
|
||||
overlay.toggleClass( 'collapsed' ).toggleClass( 'expanded' );
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
// Create a potential postMessage connection with the parent frame.
|
||||
parent = new api.Messenger({
|
||||
url: api.settings.url.parent,
|
||||
channel: 'loader'
|
||||
});
|
||||
|
||||
// If we receive a 'back' event, we're inside an iframe.
|
||||
// Send any clicks to the 'Return' link to the parent page.
|
||||
parent.bind( 'back', function() {
|
||||
$('.back').on( 'click.back', function( event ) {
|
||||
event.preventDefault();
|
||||
parent.send( 'close' );
|
||||
});
|
||||
});
|
||||
|
||||
// Pass events through to the parent.
|
||||
api.bind( 'saved', function() {
|
||||
parent.send( 'saved' );
|
||||
});
|
||||
|
||||
// When activated, let the loader handle redirecting the page.
|
||||
// If no loader exists, redirect the page ourselves (if a url exists).
|
||||
api.bind( 'activated', function() {
|
||||
if ( parent.targetWindow() )
|
||||
parent.send( 'activated', api.settings.url.activated );
|
||||
else if ( api.settings.url.activated )
|
||||
window.location = api.settings.url.activated;
|
||||
});
|
||||
|
||||
// Initialize the connection with the parent frame.
|
||||
parent.send( 'ready' );
|
||||
|
||||
// Control visibility for default controls
|
||||
$.each({
|
||||
'background_image': {
|
||||
controls: [ 'background_repeat', 'background_position_x', 'background_attachment' ],
|
||||
callback: function( to ) { return !! to }
|
||||
},
|
||||
'show_on_front': {
|
||||
controls: [ 'page_on_front', 'page_for_posts' ],
|
||||
callback: function( to ) { return 'page' === to }
|
||||
},
|
||||
'header_textcolor': {
|
||||
controls: [ 'header_textcolor' ],
|
||||
callback: function( to ) { return 'blank' !== to }
|
||||
}
|
||||
}, function( settingId, o ) {
|
||||
api( settingId, function( setting ) {
|
||||
$.each( o.controls, function( i, controlId ) {
|
||||
api.control( controlId, function( control ) {
|
||||
var visibility = function( to ) {
|
||||
control.container.toggle( o.callback( to ) );
|
||||
};
|
||||
|
||||
visibility( setting.get() );
|
||||
setting.bind( visibility );
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Juggle the two controls that use header_textcolor
|
||||
api.control( 'display_header_text', function( control ) {
|
||||
var last = '';
|
||||
|
||||
control.elements[0].unsync( api( 'header_textcolor' ) );
|
||||
|
||||
control.element = new api.Element( control.container.find('input') );
|
||||
control.element.set( 'blank' !== control.setting() );
|
||||
|
||||
control.element.bind( function( to ) {
|
||||
if ( ! to )
|
||||
last = api( 'header_textcolor' ).get();
|
||||
|
||||
control.setting.set( to ? last : 'blank' );
|
||||
});
|
||||
|
||||
control.setting.bind( function( to ) {
|
||||
control.element.set( 'blank' !== to );
|
||||
});
|
||||
});
|
||||
|
||||
// Handle header image data
|
||||
api.control( 'header_image', function( control ) {
|
||||
control.setting.bind( function( to ) {
|
||||
if ( to === control.params.removed )
|
||||
control.settings.data.set( false );
|
||||
});
|
||||
|
||||
control.library.on( 'click', 'a', function( event ) {
|
||||
control.settings.data.set( $(this).data('customizeHeaderImageData') );
|
||||
});
|
||||
|
||||
control.uploader.success = function( attachment ) {
|
||||
var data;
|
||||
|
||||
api.ImageControl.prototype.success.call( control, attachment );
|
||||
|
||||
data = {
|
||||
attachment_id: attachment.id,
|
||||
url: attachment.url,
|
||||
thumbnail_url: attachment.url,
|
||||
height: attachment.meta.height,
|
||||
width: attachment.meta.width
|
||||
};
|
||||
|
||||
attachment.element.data( 'customizeHeaderImageData', data );
|
||||
control.settings.data.set( data );
|
||||
}
|
||||
});
|
||||
|
||||
api.trigger( 'ready' );
|
||||
});
|
||||
|
||||
})( wp, jQuery );
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,93 +0,0 @@
|
|||
var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
|
||||
|
||||
jQuery(document).ready( function($) {
|
||||
/* Dashboard Welcome Panel */
|
||||
var welcomePanel = $('#welcome-panel'),
|
||||
welcomePanelHide = $('#wp_welcome_panel-hide'),
|
||||
updateWelcomePanel = function( visible ) {
|
||||
$.post( ajaxurl, {
|
||||
action: 'update-welcome-panel',
|
||||
visible: visible,
|
||||
welcomepanelnonce: $('#welcomepanelnonce').val()
|
||||
});
|
||||
};
|
||||
|
||||
if ( welcomePanel.hasClass('hidden') && welcomePanelHide.prop('checked') )
|
||||
welcomePanel.removeClass('hidden');
|
||||
|
||||
$('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function(e) {
|
||||
e.preventDefault();
|
||||
welcomePanel.addClass('hidden');
|
||||
updateWelcomePanel( 0 );
|
||||
$('#wp_welcome_panel-hide').prop('checked', false);
|
||||
});
|
||||
|
||||
welcomePanelHide.click( function() {
|
||||
welcomePanel.toggleClass('hidden', ! this.checked );
|
||||
updateWelcomePanel( this.checked ? 1 : 0 );
|
||||
});
|
||||
|
||||
// These widgets are sometimes populated via ajax
|
||||
ajaxWidgets = [
|
||||
'dashboard_incoming_links',
|
||||
'dashboard_primary',
|
||||
'dashboard_secondary',
|
||||
'dashboard_plugins'
|
||||
];
|
||||
|
||||
ajaxPopulateWidgets = function(el) {
|
||||
function show(i, id) {
|
||||
var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading');
|
||||
if ( e.length ) {
|
||||
p = e.parent();
|
||||
setTimeout( function(){
|
||||
p.load( ajaxurl + '?action=dashboard-widgets&widget=' + id, '', function() {
|
||||
p.hide().slideDown('normal', function(){
|
||||
$(this).css('display', '');
|
||||
});
|
||||
});
|
||||
}, i * 500 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( el ) {
|
||||
el = el.toString();
|
||||
if ( $.inArray(el, ajaxWidgets) != -1 )
|
||||
show(0, el);
|
||||
} else {
|
||||
$.each( ajaxWidgets, show );
|
||||
}
|
||||
};
|
||||
ajaxPopulateWidgets();
|
||||
|
||||
postboxes.add_postbox_toggles(pagenow, { pbshow: ajaxPopulateWidgets } );
|
||||
|
||||
/* QuickPress */
|
||||
quickPressLoad = function() {
|
||||
var act = $('#quickpost-action'), t;
|
||||
t = $('#quick-press').submit( function() {
|
||||
$('#dashboard_quick_press #publishing-action img.waiting').css('visibility', 'visible');
|
||||
$('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop('disabled', true);
|
||||
|
||||
if ( 'post' == act.val() ) {
|
||||
act.val( 'post-quickpress-publish' );
|
||||
}
|
||||
|
||||
$('#dashboard_quick_press div.inside').load( t.attr( 'action' ), t.serializeArray(), function() {
|
||||
$('#dashboard_quick_press #publishing-action img.waiting').css('visibility', 'hidden');
|
||||
$('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop('disabled', false);
|
||||
$('#dashboard_quick_press ul').next('p').remove();
|
||||
$('#dashboard_quick_press ul').find('li').each( function() {
|
||||
$('#dashboard_recent_drafts ul').prepend( this );
|
||||
} ).end().remove();
|
||||
quickPressLoad();
|
||||
} );
|
||||
return false;
|
||||
} );
|
||||
|
||||
$('#publish').click( function() { act.val( 'post-quickpress-publish' ); } );
|
||||
|
||||
};
|
||||
quickPressLoad();
|
||||
|
||||
} );
|
|
@ -1 +1,93 @@
|
|||
var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(c){var d=c("#welcome-panel"),a=c("#wp_welcome_panel-hide"),b=function(e){c.post(ajaxurl,{action:"update-welcome-panel",visible:e,welcomepanelnonce:c("#welcomepanelnonce").val()})};if(d.hasClass("hidden")&&a.prop("checked")){d.removeClass("hidden")}c(".welcome-panel-close, .welcome-panel-dismiss a",d).click(function(f){f.preventDefault();d.addClass("hidden");b(0);c("#wp_welcome_panel-hide").prop("checked",false)});a.click(function(){d.toggleClass("hidden",!this.checked);b(this.checked?1:0)});ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];ajaxPopulateWidgets=function(f){function e(g,k){var j,h=c("#"+k+" div.inside:visible").find(".widget-loading");if(h.length){j=h.parent();setTimeout(function(){j.load(ajaxurl+"?action=dashboard-widgets&widget="+k,"",function(){j.hide().slideDown("normal",function(){c(this).css("display","")})})},g*500)}}if(f){f=f.toString();if(c.inArray(f,ajaxWidgets)!=-1){e(0,f)}}else{c.each(ajaxWidgets,e)}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var e=c("#quickpost-action"),f;f=c("#quick-press").submit(function(){c("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",true);if("post"==e.val()){e.val("post-quickpress-publish")}c("#dashboard_quick_press div.inside").load(f.attr("action"),f.serializeArray(),function(){c("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",false);c("#dashboard_quick_press ul").next("p").remove();c("#dashboard_quick_press ul").find("li").each(function(){c("#dashboard_recent_drafts ul").prepend(this)}).end().remove();quickPressLoad()});return false});c("#publish").click(function(){e.val("post-quickpress-publish")})};quickPressLoad()});
|
||||
var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
|
||||
|
||||
jQuery(document).ready( function($) {
|
||||
/* Dashboard Welcome Panel */
|
||||
var welcomePanel = $('#welcome-panel'),
|
||||
welcomePanelHide = $('#wp_welcome_panel-hide'),
|
||||
updateWelcomePanel = function( visible ) {
|
||||
$.post( ajaxurl, {
|
||||
action: 'update-welcome-panel',
|
||||
visible: visible,
|
||||
welcomepanelnonce: $('#welcomepanelnonce').val()
|
||||
});
|
||||
};
|
||||
|
||||
if ( welcomePanel.hasClass('hidden') && welcomePanelHide.prop('checked') )
|
||||
welcomePanel.removeClass('hidden');
|
||||
|
||||
$('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function(e) {
|
||||
e.preventDefault();
|
||||
welcomePanel.addClass('hidden');
|
||||
updateWelcomePanel( 0 );
|
||||
$('#wp_welcome_panel-hide').prop('checked', false);
|
||||
});
|
||||
|
||||
welcomePanelHide.click( function() {
|
||||
welcomePanel.toggleClass('hidden', ! this.checked );
|
||||
updateWelcomePanel( this.checked ? 1 : 0 );
|
||||
});
|
||||
|
||||
// These widgets are sometimes populated via ajax
|
||||
ajaxWidgets = [
|
||||
'dashboard_incoming_links',
|
||||
'dashboard_primary',
|
||||
'dashboard_secondary',
|
||||
'dashboard_plugins'
|
||||
];
|
||||
|
||||
ajaxPopulateWidgets = function(el) {
|
||||
function show(i, id) {
|
||||
var p, e = $('#' + id + ' div.inside:visible').find('.widget-loading');
|
||||
if ( e.length ) {
|
||||
p = e.parent();
|
||||
setTimeout( function(){
|
||||
p.load( ajaxurl + '?action=dashboard-widgets&widget=' + id, '', function() {
|
||||
p.hide().slideDown('normal', function(){
|
||||
$(this).css('display', '');
|
||||
});
|
||||
});
|
||||
}, i * 500 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( el ) {
|
||||
el = el.toString();
|
||||
if ( $.inArray(el, ajaxWidgets) != -1 )
|
||||
show(0, el);
|
||||
} else {
|
||||
$.each( ajaxWidgets, show );
|
||||
}
|
||||
};
|
||||
ajaxPopulateWidgets();
|
||||
|
||||
postboxes.add_postbox_toggles(pagenow, { pbshow: ajaxPopulateWidgets } );
|
||||
|
||||
/* QuickPress */
|
||||
quickPressLoad = function() {
|
||||
var act = $('#quickpost-action'), t;
|
||||
t = $('#quick-press').submit( function() {
|
||||
$('#dashboard_quick_press #publishing-action img.waiting').css('visibility', 'visible');
|
||||
$('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop('disabled', true);
|
||||
|
||||
if ( 'post' == act.val() ) {
|
||||
act.val( 'post-quickpress-publish' );
|
||||
}
|
||||
|
||||
$('#dashboard_quick_press div.inside').load( t.attr( 'action' ), t.serializeArray(), function() {
|
||||
$('#dashboard_quick_press #publishing-action img.waiting').css('visibility', 'hidden');
|
||||
$('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop('disabled', false);
|
||||
$('#dashboard_quick_press ul').next('p').remove();
|
||||
$('#dashboard_quick_press ul').find('li').each( function() {
|
||||
$('#dashboard_recent_drafts ul').prepend( this );
|
||||
} ).end().remove();
|
||||
quickPressLoad();
|
||||
} );
|
||||
return false;
|
||||
} );
|
||||
|
||||
$('#publish').click( function() { act.val( 'post-quickpress-publish' ); } );
|
||||
|
||||
};
|
||||
quickPressLoad();
|
||||
|
||||
} );
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(c){var d=c("#welcome-panel"),a=c("#wp_welcome_panel-hide"),b=function(e){c.post(ajaxurl,{action:"update-welcome-panel",visible:e,welcomepanelnonce:c("#welcomepanelnonce").val()})};if(d.hasClass("hidden")&&a.prop("checked")){d.removeClass("hidden")}c(".welcome-panel-close, .welcome-panel-dismiss a",d).click(function(f){f.preventDefault();d.addClass("hidden");b(0);c("#wp_welcome_panel-hide").prop("checked",false)});a.click(function(){d.toggleClass("hidden",!this.checked);b(this.checked?1:0)});ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];ajaxPopulateWidgets=function(f){function e(g,k){var j,h=c("#"+k+" div.inside:visible").find(".widget-loading");if(h.length){j=h.parent();setTimeout(function(){j.load(ajaxurl+"?action=dashboard-widgets&widget="+k,"",function(){j.hide().slideDown("normal",function(){c(this).css("display","")})})},g*500)}}if(f){f=f.toString();if(c.inArray(f,ajaxWidgets)!=-1){e(0,f)}}else{c.each(ajaxWidgets,e)}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var e=c("#quickpost-action"),f;f=c("#quick-press").submit(function(){c("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",true);if("post"==e.val()){e.val("post-quickpress-publish")}c("#dashboard_quick_press div.inside").load(f.attr("action"),f.serializeArray(),function(){c("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",false);c("#dashboard_quick_press ul").next("p").remove();c("#dashboard_quick_press ul").find("li").each(function(){c("#dashboard_recent_drafts ul").prepend(this)}).end().remove();quickPressLoad()});return false});c("#publish").click(function(){e.val("post-quickpress-publish")})};quickPressLoad()});
|
|
@ -1,606 +0,0 @@
|
|||
var theList, theExtraList, toggleWithKeyboard = false;
|
||||
|
||||
(function($) {
|
||||
var getCount, updateCount, updatePending, dashboardTotals;
|
||||
|
||||
setCommentsList = function() {
|
||||
var totalInput, perPageInput, pageInput, lastConfidentTime = 0, dimAfter, delBefore, updateTotalCount, delAfter, refillTheExtraList;
|
||||
|
||||
totalInput = $('input[name="_total"]', '#comments-form');
|
||||
perPageInput = $('input[name="_per_page"]', '#comments-form');
|
||||
pageInput = $('input[name="_page"]', '#comments-form');
|
||||
|
||||
dimAfter = function( r, settings ) {
|
||||
var c = $('#' + settings.element), editRow, replyID, replyButton;
|
||||
|
||||
editRow = $('#replyrow');
|
||||
replyID = $('#comment_ID', editRow).val();
|
||||
replyButton = $('#replybtn', editRow);
|
||||
|
||||
if ( c.is('.unapproved') ) {
|
||||
if ( settings.data.id == replyID )
|
||||
replyButton.text(adminCommentsL10n.replyApprove);
|
||||
|
||||
c.find('div.comment_status').html('0');
|
||||
} else {
|
||||
if ( settings.data.id == replyID )
|
||||
replyButton.text(adminCommentsL10n.reply);
|
||||
|
||||
c.find('div.comment_status').html('1');
|
||||
}
|
||||
|
||||
var diff = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1;
|
||||
updatePending( diff );
|
||||
};
|
||||
|
||||
// Send current total, page, per_page and url
|
||||
delBefore = function( settings, list ) {
|
||||
var cl = $(settings.target).attr('class'), id, el, n, h, a, author, action = false;
|
||||
|
||||
settings.data._total = totalInput.val() || 0;
|
||||
settings.data._per_page = perPageInput.val() || 0;
|
||||
settings.data._page = pageInput.val() || 0;
|
||||
settings.data._url = document.location.href;
|
||||
settings.data.comment_status = $('input[name="comment_status"]', '#comments-form').val();
|
||||
|
||||
if ( cl.indexOf(':trash=1') != -1 )
|
||||
action = 'trash';
|
||||
else if ( cl.indexOf(':spam=1') != -1 )
|
||||
action = 'spam';
|
||||
|
||||
if ( action ) {
|
||||
id = cl.replace(/.*?comment-([0-9]+).*/, '$1');
|
||||
el = $('#comment-' + id);
|
||||
note = $('#' + action + '-undo-holder').html();
|
||||
|
||||
el.find('.check-column :checkbox').prop('checked', false); // Uncheck the row so as not to be affected by Bulk Edits.
|
||||
|
||||
if ( el.siblings('#replyrow').length && commentReply.cid == id )
|
||||
commentReply.close();
|
||||
|
||||
if ( el.is('tr') ) {
|
||||
n = el.children(':visible').length;
|
||||
author = $('.author strong', el).text();
|
||||
h = $('<tr id="undo-' + id + '" class="undo un' + action + '" style="display:none;"><td colspan="' + n + '">' + note + '</td></tr>');
|
||||
} else {
|
||||
author = $('.comment-author', el).text();
|
||||
h = $('<div id="undo-' + id + '" style="display:none;" class="undo un' + action + '">' + note + '</div>');
|
||||
}
|
||||
|
||||
el.before(h);
|
||||
|
||||
$('strong', '#undo-' + id).text(author);
|
||||
a = $('.undo a', '#undo-' + id);
|
||||
a.attr('href', 'comment.php?action=un' + action + 'comment&c=' + id + '&_wpnonce=' + settings.data._ajax_nonce);
|
||||
a.attr('class', 'delete:the-comment-list:comment-' + id + '::un' + action + '=1 vim-z vim-destructive');
|
||||
$('.avatar', el).clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside');
|
||||
|
||||
a.click(function(){
|
||||
list.wpList.del(this);
|
||||
$('#undo-' + id).css( {backgroundColor:'#ceb'} ).fadeOut(350, function(){
|
||||
$(this).remove();
|
||||
$('#comment-' + id).css('backgroundColor', '').fadeIn(300, function(){ $(this).show() });
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
return settings;
|
||||
};
|
||||
|
||||
// Updates the current total (stored in the _total input)
|
||||
updateTotalCount = function( total, time, setConfidentTime ) {
|
||||
if ( time < lastConfidentTime )
|
||||
return;
|
||||
|
||||
if ( setConfidentTime )
|
||||
lastConfidentTime = time;
|
||||
|
||||
totalInput.val( total.toString() );
|
||||
};
|
||||
|
||||
dashboardTotals = function(n) {
|
||||
var dash = $('#dashboard_right_now'), total, appr, totalN, apprN;
|
||||
|
||||
n = n || 0;
|
||||
if ( isNaN(n) || !dash.length )
|
||||
return;
|
||||
|
||||
total = $('span.total-count', dash);
|
||||
appr = $('span.approved-count', dash);
|
||||
totalN = getCount(total);
|
||||
|
||||
totalN = totalN + n;
|
||||
apprN = totalN - getCount( $('span.pending-count', dash) ) - getCount( $('span.spam-count', dash) );
|
||||
updateCount(total, totalN);
|
||||
updateCount(appr, apprN);
|
||||
};
|
||||
|
||||
getCount = function(el) {
|
||||
var n = parseInt( el.html().replace(/[^0-9]+/g, ''), 10 );
|
||||
if ( isNaN(n) )
|
||||
return 0;
|
||||
return n;
|
||||
};
|
||||
|
||||
updateCount = function(el, n) {
|
||||
var n1 = '';
|
||||
if ( isNaN(n) )
|
||||
return;
|
||||
n = n < 1 ? '0' : n.toString();
|
||||
if ( n.length > 3 ) {
|
||||
while ( n.length > 3 ) {
|
||||
n1 = thousandsSeparator + n.substr(n.length - 3) + n1;
|
||||
n = n.substr(0, n.length - 3);
|
||||
}
|
||||
n = n + n1;
|
||||
}
|
||||
el.html(n);
|
||||
};
|
||||
|
||||
updatePending = function( diff ) {
|
||||
$('span.pending-count').each(function() {
|
||||
var a = $(this), n = getCount(a) + diff;
|
||||
if ( n < 1 )
|
||||
n = 0;
|
||||
a.closest('.awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
|
||||
updateCount( a, n );
|
||||
});
|
||||
|
||||
dashboardTotals();
|
||||
};
|
||||
|
||||
// In admin-ajax.php, we send back the unix time stamp instead of 1 on success
|
||||
delAfter = function( r, settings ) {
|
||||
var total, N, spam, trash, pending,
|
||||
untrash = $(settings.target).parent().is('span.untrash'),
|
||||
unspam = $(settings.target).parent().is('span.unspam'),
|
||||
unapproved = $('#' + settings.element).is('.unapproved');
|
||||
|
||||
function getUpdate(s) {
|
||||
if ( $(settings.target).parent().is('span.' + s) )
|
||||
return 1;
|
||||
else if ( $('#' + settings.element).is('.' + s) )
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( untrash )
|
||||
trash = -1;
|
||||
else
|
||||
trash = getUpdate('trash');
|
||||
|
||||
if ( unspam )
|
||||
spam = -1;
|
||||
else
|
||||
spam = getUpdate('spam');
|
||||
|
||||
if ( $(settings.target).parent().is('span.unapprove') || ( ( untrash || unspam ) && unapproved ) ) {
|
||||
// a comment was 'deleted' from another list (e.g. approved, spam, trash) and moved to pending,
|
||||
// or a trash/spam of a pending comment was undone
|
||||
pending = 1;
|
||||
} else if ( unapproved ) {
|
||||
// a pending comment was trashed/spammed/approved
|
||||
pending = -1;
|
||||
}
|
||||
|
||||
if ( pending )
|
||||
updatePending(pending);
|
||||
|
||||
$('span.spam-count').each( function() {
|
||||
var a = $(this), n = getCount(a) + spam;
|
||||
updateCount(a, n);
|
||||
});
|
||||
|
||||
$('span.trash-count').each( function() {
|
||||
var a = $(this), n = getCount(a) + trash;
|
||||
updateCount(a, n);
|
||||
});
|
||||
|
||||
if ( $('#dashboard_right_now').length ) {
|
||||
N = trash ? -1 * trash : 0;
|
||||
dashboardTotals(N);
|
||||
} else {
|
||||
total = totalInput.val() ? parseInt( totalInput.val(), 10 ) : 0;
|
||||
if ( $(settings.target).parent().is('span.undo') )
|
||||
total++;
|
||||
else
|
||||
total--;
|
||||
|
||||
if ( total < 0 )
|
||||
total = 0;
|
||||
|
||||
if ( ( 'object' == typeof r ) && lastConfidentTime < settings.parsed.responses[0].supplemental.time ) {
|
||||
total_items_i18n = settings.parsed.responses[0].supplemental.total_items_i18n || '';
|
||||
if ( total_items_i18n ) {
|
||||
$('.displaying-num').text( total_items_i18n );
|
||||
$('.total-pages').text( settings.parsed.responses[0].supplemental.total_pages_i18n );
|
||||
$('.tablenav-pages').find('.next-page, .last-page').toggleClass('disabled', settings.parsed.responses[0].supplemental.total_pages == $('.current-page').val());
|
||||
}
|
||||
updateTotalCount( total, settings.parsed.responses[0].supplemental.time, true );
|
||||
} else {
|
||||
updateTotalCount( total, r, false );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! theExtraList || theExtraList.size() == 0 || theExtraList.children().size() == 0 || untrash || unspam ) {
|
||||
return;
|
||||
}
|
||||
|
||||
theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() );
|
||||
|
||||
refillTheExtraList();
|
||||
};
|
||||
|
||||
refillTheExtraList = function(ev) {
|
||||
var args = $.query.get(), total_pages = $('.total-pages').text(), per_page = $('input[name="_per_page"]', '#comments-form').val();
|
||||
|
||||
if (! args.paged)
|
||||
args.paged = 1;
|
||||
|
||||
if (args.paged > total_pages) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ev) {
|
||||
theExtraList.empty();
|
||||
args.number = Math.min(8, per_page); // see WP_Comments_List_Table::prepare_items() @ class-wp-comments-list-table.php
|
||||
} else {
|
||||
args.number = 1;
|
||||
args.offset = Math.min(8, per_page) - 1; // fetch only the next item on the extra list
|
||||
}
|
||||
|
||||
args.no_placeholder = true;
|
||||
|
||||
args.paged ++;
|
||||
|
||||
// $.query.get() needs some correction to be sent into an ajax request
|
||||
if ( true === args.comment_type )
|
||||
args.comment_type = '';
|
||||
|
||||
args = $.extend(args, {
|
||||
'action': 'fetch-list',
|
||||
'list_args': list_args,
|
||||
'_ajax_fetch_list_nonce': $('#_ajax_fetch_list_nonce').val()
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: ajaxurl,
|
||||
global: false,
|
||||
dataType: 'json',
|
||||
data: args,
|
||||
success: function(response) {
|
||||
theExtraList.get(0).wpList.add( response.rows );
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
|
||||
theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )
|
||||
.bind('wpListDelEnd', function(e, s){
|
||||
var id = s.element.replace(/[^0-9]+/g, '');
|
||||
|
||||
if ( s.target.className.indexOf(':trash=1') != -1 || s.target.className.indexOf(':spam=1') != -1 )
|
||||
$('#undo-' + id).fadeIn(300, function(){ $(this).show() });
|
||||
});
|
||||
};
|
||||
|
||||
commentReply = {
|
||||
cid : '',
|
||||
act : '',
|
||||
|
||||
init : function() {
|
||||
var row = $('#replyrow');
|
||||
|
||||
$('a.cancel', row).click(function() { return commentReply.revert(); });
|
||||
$('a.save', row).click(function() { return commentReply.send(); });
|
||||
$('input#author, input#author-email, input#author-url', row).keypress(function(e){
|
||||
if ( e.which == 13 ) {
|
||||
commentReply.send();
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// add events
|
||||
$('#the-comment-list .column-comment > p').dblclick(function(){
|
||||
commentReply.toggle($(this).parent());
|
||||
});
|
||||
|
||||
$('#doaction, #doaction2, #post-query-submit').click(function(e){
|
||||
if ( $('#the-comment-list #replyrow').length > 0 )
|
||||
commentReply.close();
|
||||
});
|
||||
|
||||
this.comments_listing = $('#comments-form > input[name="comment_status"]').val() || '';
|
||||
|
||||
/* $(listTable).bind('beforeChangePage', function(){
|
||||
commentReply.close();
|
||||
}); */
|
||||
},
|
||||
|
||||
addEvents : function(r) {
|
||||
r.each(function() {
|
||||
$(this).find('.column-comment > p').dblclick(function(){
|
||||
commentReply.toggle($(this).parent());
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
toggle : function(el) {
|
||||
if ( $(el).css('display') != 'none' )
|
||||
$(el).find('a.vim-q').click();
|
||||
},
|
||||
|
||||
revert : function() {
|
||||
|
||||
if ( $('#the-comment-list #replyrow').length < 1 )
|
||||
return false;
|
||||
|
||||
$('#replyrow').fadeOut('fast', function(){
|
||||
commentReply.close();
|
||||
});
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
close : function() {
|
||||
var c, replyrow = $('#replyrow');
|
||||
|
||||
// replyrow is not showing?
|
||||
if ( replyrow.parent().is('#com-reply') )
|
||||
return;
|
||||
|
||||
if ( this.cid && this.act == 'edit-comment' ) {
|
||||
c = $('#comment-' + this.cid);
|
||||
c.fadeIn(300, function(){ c.show() }).css('backgroundColor', '');
|
||||
}
|
||||
|
||||
// reset the Quicktags buttons
|
||||
if ( typeof QTags != 'undefined' )
|
||||
QTags.closeAllTags('replycontent');
|
||||
|
||||
$('#add-new-comment').css('display', '');
|
||||
|
||||
replyrow.hide();
|
||||
$('#com-reply').append( replyrow );
|
||||
$('#replycontent').css('height', '').val('');
|
||||
$('#edithead input').val('');
|
||||
$('.error', replyrow).html('').hide();
|
||||
$('.waiting', replyrow).hide();
|
||||
|
||||
this.cid = '';
|
||||
},
|
||||
|
||||
open : function(comment_id, post_id, action) {
|
||||
var t = this, editRow, rowData, act, c = $('#comment-' + comment_id), h = c.height(), replyButton;
|
||||
|
||||
t.close();
|
||||
t.cid = comment_id;
|
||||
|
||||
editRow = $('#replyrow');
|
||||
rowData = $('#inline-'+comment_id);
|
||||
action = action || 'replyto';
|
||||
act = 'edit' == action ? 'edit' : 'replyto';
|
||||
act = t.act = act + '-comment';
|
||||
|
||||
$('#action', editRow).val(act);
|
||||
$('#comment_post_ID', editRow).val(post_id);
|
||||
$('#comment_ID', editRow).val(comment_id);
|
||||
|
||||
if ( h > 120 )
|
||||
$('#replycontent', editRow).css('height', (35+h) + 'px');
|
||||
|
||||
if ( action == 'edit' ) {
|
||||
$('#author', editRow).val( $('div.author', rowData).text() );
|
||||
$('#author-email', editRow).val( $('div.author-email', rowData).text() );
|
||||
$('#author-url', editRow).val( $('div.author-url', rowData).text() );
|
||||
$('#status', editRow).val( $('div.comment_status', rowData).text() );
|
||||
$('#replycontent', editRow).val( $('textarea.comment', rowData).val() );
|
||||
$('#edithead, #savebtn', editRow).show();
|
||||
$('#replyhead, #replybtn, #addhead, #addbtn', editRow).hide();
|
||||
|
||||
c.after( editRow ).fadeOut('fast', function(){
|
||||
$('#replyrow').fadeIn(300, function(){ $(this).show() });
|
||||
});
|
||||
} else if ( action == 'add' ) {
|
||||
$('#addhead, #addbtn', editRow).show();
|
||||
$('#replyhead, #replybtn, #edithead, #editbtn', editRow).hide();
|
||||
$('#the-comment-list').prepend(editRow);
|
||||
$('#replyrow').fadeIn(300);
|
||||
} else {
|
||||
replyButton = $('#replybtn', editRow);
|
||||
$('#edithead, #savebtn, #addhead, #addbtn', editRow).hide();
|
||||
$('#replyhead, #replybtn', editRow).show();
|
||||
c.after(editRow);
|
||||
|
||||
if ( c.hasClass('unapproved') ) {
|
||||
replyButton.text(adminCommentsL10n.replyApprove);
|
||||
} else {
|
||||
replyButton.text(adminCommentsL10n.reply);
|
||||
}
|
||||
|
||||
$('#replyrow').fadeIn(300, function(){ $(this).show() });
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
var rtop, rbottom, scrollTop, vp, scrollBottom;
|
||||
|
||||
rtop = $('#replyrow').offset().top;
|
||||
rbottom = rtop + $('#replyrow').height();
|
||||
scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
||||
vp = document.documentElement.clientHeight || self.innerHeight || 0;
|
||||
scrollBottom = scrollTop + vp;
|
||||
|
||||
if ( scrollBottom - 20 < rbottom )
|
||||
window.scroll(0, rbottom - vp + 35);
|
||||
else if ( rtop - 20 < scrollTop )
|
||||
window.scroll(0, rtop - 35);
|
||||
|
||||
$('#replycontent').focus().keyup(function(e){
|
||||
if ( e.which == 27 )
|
||||
commentReply.revert(); // close on Escape
|
||||
});
|
||||
}, 600);
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
send : function() {
|
||||
var post = {};
|
||||
|
||||
$('#replysubmit .error').hide();
|
||||
$('#replysubmit .waiting').show();
|
||||
|
||||
$('#replyrow input').not(':button').each(function() {
|
||||
var t = $(this);
|
||||
post[ t.attr('name') ] = t.val();
|
||||
});
|
||||
|
||||
post.content = $('#replycontent').val();
|
||||
post.id = post.comment_post_ID;
|
||||
post.comments_listing = this.comments_listing;
|
||||
post.p = $('[name="p"]').val();
|
||||
|
||||
if ( $('#comment-' + $('#comment_ID').val()).hasClass('unapproved') )
|
||||
post.approve_parent = 1;
|
||||
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : ajaxurl,
|
||||
data : post,
|
||||
success : function(x) { commentReply.show(x); },
|
||||
error : function(r) { commentReply.error(r); }
|
||||
});
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
show : function(xml) {
|
||||
var t = this, r, c, id, bg, pid;
|
||||
|
||||
if ( typeof(xml) == 'string' ) {
|
||||
t.error({'responseText': xml});
|
||||
return false;
|
||||
}
|
||||
|
||||
r = wpAjax.parseAjaxResponse(xml);
|
||||
if ( r.errors ) {
|
||||
t.error({'responseText': wpAjax.broken});
|
||||
return false;
|
||||
}
|
||||
|
||||
t.revert();
|
||||
|
||||
r = r.responses[0];
|
||||
c = r.data;
|
||||
id = '#comment-' + r.id;
|
||||
|
||||
if ( 'edit-comment' == t.act )
|
||||
$(id).remove();
|
||||
|
||||
if ( r.supplemental.parent_approved ) {
|
||||
pid = $('#comment-' + r.supplemental.parent_approved);
|
||||
updatePending( -1 );
|
||||
|
||||
if ( this.comments_listing == 'moderated' ) {
|
||||
pid.animate( { 'backgroundColor':'#CCEEBB' }, 400, function(){
|
||||
pid.fadeOut();
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$(c).hide()
|
||||
$('#replyrow').after(c);
|
||||
id = $(id);
|
||||
t.addEvents(id);
|
||||
bg = id.hasClass('unapproved') ? '#FFFFE0' : id.closest('.widefat, .postbox').css('backgroundColor');
|
||||
|
||||
id.animate( { 'backgroundColor':'#CCEEBB' }, 300 )
|
||||
.animate( { 'backgroundColor': bg }, 300, function() {
|
||||
if ( pid && pid.length ) {
|
||||
pid.animate( { 'backgroundColor':'#CCEEBB' }, 300 )
|
||||
.animate( { 'backgroundColor': bg }, 300 )
|
||||
.removeClass('unapproved').addClass('approved')
|
||||
.find('div.comment_status').html('1');
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
error : function(r) {
|
||||
var er = r.statusText;
|
||||
|
||||
$('#replysubmit .waiting').hide();
|
||||
|
||||
if ( r.responseText )
|
||||
er = r.responseText.replace( /<.[^<>]*?>/g, '' );
|
||||
|
||||
if ( er )
|
||||
$('#replysubmit .error').html(er).show();
|
||||
|
||||
},
|
||||
|
||||
addcomment: function(post_id) {
|
||||
var t = this;
|
||||
|
||||
$('#add-new-comment').fadeOut(200, function(){
|
||||
t.open(0, post_id, 'add');
|
||||
$('table.comments-box').css('display', '');
|
||||
$('#no-comments').remove();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function(){
|
||||
var make_hotkeys_redirect, edit_comment, toggle_all, make_bulk;
|
||||
|
||||
setCommentsList();
|
||||
commentReply.init();
|
||||
$(document).delegate('span.delete a.delete', 'click', function(){return false;});
|
||||
|
||||
if ( typeof $.table_hotkeys != 'undefined' ) {
|
||||
make_hotkeys_redirect = function(which) {
|
||||
return function() {
|
||||
var first_last, l;
|
||||
|
||||
first_last = 'next' == which? 'first' : 'last';
|
||||
l = $('.tablenav-pages .'+which+'-page:not(.disabled)');
|
||||
if (l.length)
|
||||
window.location = l[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g, '')+'&hotkeys_highlight_'+first_last+'=1';
|
||||
}
|
||||
};
|
||||
|
||||
edit_comment = function(event, current_row) {
|
||||
window.location = $('span.edit a', current_row).attr('href');
|
||||
};
|
||||
|
||||
toggle_all = function() {
|
||||
toggleWithKeyboard = true;
|
||||
$('input:checkbox', '#cb').click().prop('checked', false);
|
||||
toggleWithKeyboard = false;
|
||||
};
|
||||
|
||||
make_bulk = function(value) {
|
||||
return function() {
|
||||
var scope = $('select[name="action"]');
|
||||
$('option[value="' + value + '"]', scope).prop('selected', true);
|
||||
$('#doaction').click();
|
||||
}
|
||||
};
|
||||
|
||||
$.table_hotkeys(
|
||||
$('table.widefat'),
|
||||
['a', 'u', 's', 'd', 'r', 'q', 'z', ['e', edit_comment], ['shift+x', toggle_all],
|
||||
['shift+a', make_bulk('approve')], ['shift+s', make_bulk('spam')],
|
||||
['shift+d', make_bulk('delete')], ['shift+t', make_bulk('trash')],
|
||||
['shift+z', make_bulk('untrash')], ['shift+u', make_bulk('unapprove')]],
|
||||
{ highlight_first: adminCommentsL10n.hotkeys_highlight_first, highlight_last: adminCommentsL10n.hotkeys_highlight_last,
|
||||
prev_page_link_cb: make_hotkeys_redirect('prev'), next_page_link_cb: make_hotkeys_redirect('next') }
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,240 +0,0 @@
|
|||
|
||||
var switchEditors = {
|
||||
|
||||
switchto: function(el) {
|
||||
var aid = el.id, l = aid.length, id = aid.substr(0, l - 5), mode = aid.substr(l - 4);
|
||||
|
||||
this.go(id, mode);
|
||||
},
|
||||
|
||||
go: function(id, mode) { // mode can be 'html', 'tmce', or 'toggle'; 'html' is used for the "Text" editor tab.
|
||||
id = id || 'content';
|
||||
mode = mode || 'toggle';
|
||||
|
||||
var t = this, ed = tinyMCE.get(id), wrap_id, txtarea_el, dom = tinymce.DOM;
|
||||
|
||||
wrap_id = 'wp-'+id+'-wrap';
|
||||
txtarea_el = dom.get(id);
|
||||
|
||||
if ( 'toggle' == mode ) {
|
||||
if ( ed && !ed.isHidden() )
|
||||
mode = 'html';
|
||||
else
|
||||
mode = 'tmce';
|
||||
}
|
||||
|
||||
if ( 'tmce' == mode || 'tinymce' == mode ) {
|
||||
if ( ed && ! ed.isHidden() )
|
||||
return false;
|
||||
|
||||
if ( typeof(QTags) != 'undefined' )
|
||||
QTags.closeAllTags(id);
|
||||
|
||||
if ( tinyMCEPreInit.mceInit[id] && tinyMCEPreInit.mceInit[id].wpautop )
|
||||
txtarea_el.value = t.wpautop( txtarea_el.value );
|
||||
|
||||
if ( ed ) {
|
||||
ed.show();
|
||||
} else {
|
||||
ed = new tinymce.Editor(id, tinyMCEPreInit.mceInit[id]);
|
||||
ed.render();
|
||||
}
|
||||
|
||||
dom.removeClass(wrap_id, 'html-active');
|
||||
dom.addClass(wrap_id, 'tmce-active');
|
||||
setUserSetting('editor', 'tinymce');
|
||||
|
||||
} else if ( 'html' == mode ) {
|
||||
|
||||
if ( ed && ed.isHidden() )
|
||||
return false;
|
||||
|
||||
if ( ed ) {
|
||||
txtarea_el.style.height = ed.getContentAreaContainer().offsetHeight + 20 + 'px';
|
||||
ed.hide();
|
||||
}
|
||||
|
||||
dom.removeClass(wrap_id, 'tmce-active');
|
||||
dom.addClass(wrap_id, 'html-active');
|
||||
setUserSetting('editor', 'html');
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
_wp_Nop : function(content) {
|
||||
var blocklist1, blocklist2, preserve_linebreaks = false, preserve_br = false;
|
||||
|
||||
// Protect pre|script tags
|
||||
if ( content.indexOf('<pre') != -1 || content.indexOf('<script') != -1 ) {
|
||||
preserve_linebreaks = true;
|
||||
content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
|
||||
a = a.replace(/<br ?\/?>(\r\n|\n)?/g, '<wp-temp-lb>');
|
||||
return a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-temp-lb>');
|
||||
});
|
||||
}
|
||||
|
||||
// keep <br> tags inside captions and remove line breaks
|
||||
if ( content.indexOf('[caption') != -1 ) {
|
||||
preserve_br = true;
|
||||
content = content.replace(/\[caption[\s\S]+?\[\/caption\]/g, function(a) {
|
||||
return a.replace(/<br([^>]*)>/g, '<wp-temp-br$1>').replace(/[\r\n\t]+/, '');
|
||||
});
|
||||
}
|
||||
|
||||
// Pretty it up for the source editor
|
||||
blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset';
|
||||
content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'g'), '</$1>\n');
|
||||
content = content.replace(new RegExp('\\s*<((?:'+blocklist1+')(?: [^>]*)?)>', 'g'), '\n<$1>');
|
||||
|
||||
// Mark </p> if it has any attributes.
|
||||
content = content.replace(/(<p [^>]+>.*?)<\/p>/g, '$1</p#>');
|
||||
|
||||
// Sepatate <div> containing <p>
|
||||
content = content.replace(/<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n');
|
||||
|
||||
// Remove <p> and <br />
|
||||
content = content.replace(/\s*<p>/gi, '');
|
||||
content = content.replace(/\s*<\/p>\s*/gi, '\n\n');
|
||||
content = content.replace(/\n[\s\u00a0]+\n/g, '\n\n');
|
||||
content = content.replace(/\s*<br ?\/?>\s*/gi, '\n');
|
||||
|
||||
// Fix some block element newline issues
|
||||
content = content.replace(/\s*<div/g, '\n<div');
|
||||
content = content.replace(/<\/div>\s*/g, '</div>\n');
|
||||
content = content.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n');
|
||||
content = content.replace(/caption\]\n\n+\[caption/g, 'caption]\n\n[caption');
|
||||
|
||||
blocklist2 = 'blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset';
|
||||
content = content.replace(new RegExp('\\s*<((?:'+blocklist2+')(?: [^>]*)?)\\s*>', 'g'), '\n<$1>');
|
||||
content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'g'), '</$1>\n');
|
||||
content = content.replace(/<li([^>]*)>/g, '\t<li$1>');
|
||||
|
||||
if ( content.indexOf('<hr') != -1 ) {
|
||||
content = content.replace(/\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n');
|
||||
}
|
||||
|
||||
if ( content.indexOf('<object') != -1 ) {
|
||||
content = content.replace(/<object[\s\S]+?<\/object>/g, function(a){
|
||||
return a.replace(/[\r\n]+/g, '');
|
||||
});
|
||||
}
|
||||
|
||||
// Unmark special paragraph closing tags
|
||||
content = content.replace(/<\/p#>/g, '</p>\n');
|
||||
content = content.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1');
|
||||
|
||||
// Trim whitespace
|
||||
content = content.replace(/^\s+/, '');
|
||||
content = content.replace(/[\s\u00a0]+$/, '');
|
||||
|
||||
// put back the line breaks in pre|script
|
||||
if ( preserve_linebreaks )
|
||||
content = content.replace(/<wp-temp-lb>/g, '\n');
|
||||
|
||||
// and the <br> tags in captions
|
||||
if ( preserve_br )
|
||||
content = content.replace(/<wp-temp-br([^>]*)>/g, '<br$1>');
|
||||
|
||||
return content;
|
||||
},
|
||||
|
||||
_wp_Autop : function(pee) {
|
||||
var preserve_linebreaks = false, preserve_br = false,
|
||||
blocklist = 'table|thead|tfoot|tbody|tr|td|th|caption|col|colgroup|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|fieldset|legend|hr|noscript|menu|samp|header|footer|article|section|hgroup|nav|aside|details|summary';
|
||||
|
||||
if ( pee.indexOf('<object') != -1 ) {
|
||||
pee = pee.replace(/<object[\s\S]+?<\/object>/g, function(a){
|
||||
return a.replace(/[\r\n]+/g, '');
|
||||
});
|
||||
}
|
||||
|
||||
pee = pee.replace(/<[^<>]+>/g, function(a){
|
||||
return a.replace(/[\r\n]+/g, ' ');
|
||||
});
|
||||
|
||||
// Protect pre|script tags
|
||||
if ( pee.indexOf('<pre') != -1 || pee.indexOf('<script') != -1 ) {
|
||||
preserve_linebreaks = true;
|
||||
pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
|
||||
return a.replace(/(\r\n|\n)/g, '<wp-temp-lb>');
|
||||
});
|
||||
}
|
||||
|
||||
// keep <br> tags inside captions and convert line breaks
|
||||
if ( pee.indexOf('[caption') != -1 ) {
|
||||
preserve_br = true;
|
||||
pee = pee.replace(/\[caption[\s\S]+?\[\/caption\]/g, function(a) {
|
||||
// keep existing <br>
|
||||
a = a.replace(/<br([^>]*)>/g, '<wp-temp-br$1>');
|
||||
// no line breaks inside HTML tags
|
||||
a = a.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g, function(b){
|
||||
return b.replace(/[\r\n\t]+/, ' ');
|
||||
});
|
||||
// convert remaining line breaks to <br>
|
||||
return a.replace(/\s*\n\s*/g, '<wp-temp-br />');
|
||||
});
|
||||
}
|
||||
|
||||
pee = pee + '\n\n';
|
||||
pee = pee.replace(/<br \/>\s*<br \/>/gi, '\n\n');
|
||||
pee = pee.replace(new RegExp('(<(?:'+blocklist+')(?: [^>]*)?>)', 'gi'), '\n$1');
|
||||
pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), '$1\n\n');
|
||||
pee = pee.replace(/<hr( [^>]*)?>/gi, '<hr$1>\n\n'); // hr is self closing block element
|
||||
pee = pee.replace(/\r\n|\r/g, '\n');
|
||||
pee = pee.replace(/\n\s*\n+/g, '\n\n');
|
||||
pee = pee.replace(/([\s\S]+?)\n\n/g, '<p>$1</p>\n');
|
||||
pee = pee.replace(/<p>\s*?<\/p>/gi, '');
|
||||
pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')(?: [^>]*)?>)\\s*</p>', 'gi'), "$1");
|
||||
pee = pee.replace(/<p>(<li.+?)<\/p>/gi, '$1');
|
||||
pee = pee.replace(/<p>\s*<blockquote([^>]*)>/gi, '<blockquote$1><p>');
|
||||
pee = pee.replace(/<\/blockquote>\s*<\/p>/gi, '</p></blockquote>');
|
||||
pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')(?: [^>]*)?>)', 'gi'), "$1");
|
||||
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')(?: [^>]*)?>)\\s*</p>', 'gi'), "$1");
|
||||
pee = pee.replace(/\s*\n/gi, '<br />\n');
|
||||
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
|
||||
pee = pee.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi, '$1');
|
||||
pee = pee.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi, '[caption$1[/caption]');
|
||||
|
||||
pee = pee.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g, function(a, b, c) {
|
||||
if ( c.match(/<p( [^>]*)?>/) )
|
||||
return a;
|
||||
|
||||
return b + '<p>' + c + '</p>';
|
||||
});
|
||||
|
||||
// put back the line breaks in pre|script
|
||||
if ( preserve_linebreaks )
|
||||
pee = pee.replace(/<wp-temp-lb>/g, '\n');
|
||||
|
||||
if ( preserve_br )
|
||||
pee = pee.replace(/<wp-temp-br([^>]*)>/g, '<br$1>');
|
||||
|
||||
return pee;
|
||||
},
|
||||
|
||||
pre_wpautop : function(content) {
|
||||
var t = this, o = { o: t, data: content, unfiltered: content },
|
||||
q = typeof(jQuery) != 'undefined';
|
||||
|
||||
if ( q )
|
||||
jQuery('body').trigger('beforePreWpautop', [o]);
|
||||
o.data = t._wp_Nop(o.data);
|
||||
if ( q )
|
||||
jQuery('body').trigger('afterPreWpautop', [o]);
|
||||
|
||||
return o.data;
|
||||
},
|
||||
|
||||
wpautop : function(pee) {
|
||||
var t = this, o = { o: t, data: pee, unfiltered: pee },
|
||||
q = typeof(jQuery) != 'undefined';
|
||||
|
||||
if ( q )
|
||||
jQuery('body').trigger('beforeWpautop', [o]);
|
||||
o.data = t._wp_Autop(o.data);
|
||||
if ( q )
|
||||
jQuery('body').trigger('afterWpautop', [o]);
|
||||
|
||||
return o.data;
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,199 +0,0 @@
|
|||
jQuery(document).ready(function($) {
|
||||
var gallerySortable, gallerySortableInit, w, desc = false;
|
||||
|
||||
gallerySortableInit = function() {
|
||||
gallerySortable = $('#media-items').sortable( {
|
||||
items: 'div.media-item',
|
||||
placeholder: 'sorthelper',
|
||||
axis: 'y',
|
||||
distance: 2,
|
||||
handle: 'div.filename',
|
||||
stop: function(e, ui) {
|
||||
// When an update has occurred, adjust the order for each item
|
||||
var all = $('#media-items').sortable('toArray'), len = all.length;
|
||||
$.each(all, function(i, id) {
|
||||
var order = desc ? (len - i) : (1 + i);
|
||||
$('#' + id + ' .menu_order input').val(order);
|
||||
});
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
sortIt = function() {
|
||||
var all = $('.menu_order_input'), len = all.length;
|
||||
all.each(function(i){
|
||||
var order = desc ? (len - i) : (1 + i);
|
||||
$(this).val(order);
|
||||
});
|
||||
}
|
||||
|
||||
clearAll = function(c) {
|
||||
c = c || 0;
|
||||
$('.menu_order_input').each(function(){
|
||||
if ( this.value == '0' || c ) this.value = '';
|
||||
});
|
||||
}
|
||||
|
||||
$('#asc').click(function(){desc = false; sortIt(); return false;});
|
||||
$('#desc').click(function(){desc = true; sortIt(); return false;});
|
||||
$('#clear').click(function(){clearAll(1); return false;});
|
||||
$('#showall').click(function(){
|
||||
$('#sort-buttons span a').toggle();
|
||||
$('a.describe-toggle-on').hide();
|
||||
$('a.describe-toggle-off, table.slidetoggle').show();
|
||||
$('img.pinkynail').toggle(false);
|
||||
return false;
|
||||
});
|
||||
$('#hideall').click(function(){
|
||||
$('#sort-buttons span a').toggle();
|
||||
$('a.describe-toggle-on').show();
|
||||
$('a.describe-toggle-off, table.slidetoggle').hide();
|
||||
$('img.pinkynail').toggle(true);
|
||||
return false;
|
||||
});
|
||||
|
||||
// initialize sortable
|
||||
gallerySortableInit();
|
||||
clearAll();
|
||||
|
||||
if ( $('#media-items>*').length > 1 ) {
|
||||
w = wpgallery.getWin();
|
||||
|
||||
$('#save-all, #gallery-settings').show();
|
||||
if ( typeof w.tinyMCE != 'undefined' && w.tinyMCE.activeEditor && ! w.tinyMCE.activeEditor.isHidden() ) {
|
||||
wpgallery.mcemode = true;
|
||||
wpgallery.init();
|
||||
} else {
|
||||
$('#insert-gallery').show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(window).unload( function () { tinymce = tinyMCE = wpgallery = null; } ); // Cleanup
|
||||
|
||||
/* gallery settings */
|
||||
var tinymce = null, tinyMCE, wpgallery;
|
||||
|
||||
wpgallery = {
|
||||
mcemode : false,
|
||||
editor : {},
|
||||
dom : {},
|
||||
is_update : false,
|
||||
el : {},
|
||||
|
||||
I : function(e) {
|
||||
return document.getElementById(e);
|
||||
},
|
||||
|
||||
init: function() {
|
||||
var t = this, li, q, i, it, w = t.getWin();
|
||||
|
||||
if ( ! t.mcemode ) return;
|
||||
|
||||
li = ('' + document.location.search).replace(/^\?/, '').split('&');
|
||||
q = {};
|
||||
for (i=0; i<li.length; i++) {
|
||||
it = li[i].split('=');
|
||||
q[unescape(it[0])] = unescape(it[1]);
|
||||
}
|
||||
|
||||
if (q.mce_rdomain)
|
||||
document.domain = q.mce_rdomain;
|
||||
|
||||
// Find window & API
|
||||
tinymce = w.tinymce;
|
||||
tinyMCE = w.tinyMCE;
|
||||
t.editor = tinymce.EditorManager.activeEditor;
|
||||
|
||||
t.setup();
|
||||
},
|
||||
|
||||
getWin : function() {
|
||||
return window.dialogArguments || opener || parent || top;
|
||||
},
|
||||
|
||||
setup : function() {
|
||||
var t = this, a, ed = t.editor, g, columns, link, order, orderby;
|
||||
if ( ! t.mcemode ) return;
|
||||
|
||||
t.el = ed.selection.getNode();
|
||||
|
||||
if ( t.el.nodeName != 'IMG' || ! ed.dom.hasClass(t.el, 'wpGallery') ) {
|
||||
if ( (g = ed.dom.select('img.wpGallery')) && g[0] ) {
|
||||
t.el = g[0];
|
||||
} else {
|
||||
if ( getUserSetting('galfile') == '1' ) t.I('linkto-file').checked = "checked";
|
||||
if ( getUserSetting('galdesc') == '1' ) t.I('order-desc').checked = "checked";
|
||||
if ( getUserSetting('galcols') ) t.I('columns').value = getUserSetting('galcols');
|
||||
if ( getUserSetting('galord') ) t.I('orderby').value = getUserSetting('galord');
|
||||
jQuery('#insert-gallery').show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
a = ed.dom.getAttrib(t.el, 'title');
|
||||
a = ed.dom.decode(a);
|
||||
|
||||
if ( a ) {
|
||||
jQuery('#update-gallery').show();
|
||||
t.is_update = true;
|
||||
|
||||
columns = a.match(/columns=['"]([0-9]+)['"]/);
|
||||
link = a.match(/link=['"]([^'"]+)['"]/i);
|
||||
order = a.match(/order=['"]([^'"]+)['"]/i);
|
||||
orderby = a.match(/orderby=['"]([^'"]+)['"]/i);
|
||||
|
||||
if ( link && link[1] ) t.I('linkto-file').checked = "checked";
|
||||
if ( order && order[1] ) t.I('order-desc').checked = "checked";
|
||||
if ( columns && columns[1] ) t.I('columns').value = ''+columns[1];
|
||||
if ( orderby && orderby[1] ) t.I('orderby').value = orderby[1];
|
||||
} else {
|
||||
jQuery('#insert-gallery').show();
|
||||
}
|
||||
},
|
||||
|
||||
update : function() {
|
||||
var t = this, ed = t.editor, all = '', s;
|
||||
|
||||
if ( ! t.mcemode || ! t.is_update ) {
|
||||
s = '[gallery'+t.getSettings()+']';
|
||||
t.getWin().send_to_editor(s);
|
||||
return;
|
||||
}
|
||||
|
||||
if (t.el.nodeName != 'IMG') return;
|
||||
|
||||
all = ed.dom.decode(ed.dom.getAttrib(t.el, 'title'));
|
||||
all = all.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi, '');
|
||||
all += t.getSettings();
|
||||
|
||||
ed.dom.setAttrib(t.el, 'title', all);
|
||||
t.getWin().tb_remove();
|
||||
},
|
||||
|
||||
getSettings : function() {
|
||||
var I = this.I, s = '';
|
||||
|
||||
if ( I('linkto-file').checked ) {
|
||||
s += ' link="file"';
|
||||
setUserSetting('galfile', '1');
|
||||
}
|
||||
|
||||
if ( I('order-desc').checked ) {
|
||||
s += ' order="DESC"';
|
||||
setUserSetting('galdesc', '1');
|
||||
}
|
||||
|
||||
if ( I('columns').value != 3 ) {
|
||||
s += ' columns="'+I('columns').value+'"';
|
||||
setUserSetting('galcols', I('columns').value);
|
||||
}
|
||||
|
||||
if ( I('orderby').value != 'menu_order' ) {
|
||||
s += ' orderby="'+I('orderby').value+'"';
|
||||
setUserSetting('galord', I('orderby').value);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
};
|
|
@ -1 +1,199 @@
|
|||
jQuery(document).ready(function(c){var b,e,a,d=false;e=function(){b=c("#media-items").sortable({items:"div.media-item",placeholder:"sorthelper",axis:"y",distance:2,handle:"div.filename",stop:function(i,h){var g=c("#media-items").sortable("toArray"),f=g.length;c.each(g,function(k,l){var j=d?(f-k):(1+k);c("#"+l+" .menu_order input").val(j)})}})};sortIt=function(){var g=c(".menu_order_input"),f=g.length;g.each(function(j){var h=d?(f-j):(1+j);c(this).val(h)})};clearAll=function(f){f=f||0;c(".menu_order_input").each(function(){if(this.value=="0"||f){this.value=""}})};c("#asc").click(function(){d=false;sortIt();return false});c("#desc").click(function(){d=true;sortIt();return false});c("#clear").click(function(){clearAll(1);return false});c("#showall").click(function(){c("#sort-buttons span a").toggle();c("a.describe-toggle-on").hide();c("a.describe-toggle-off, table.slidetoggle").show();c("img.pinkynail").toggle(false);return false});c("#hideall").click(function(){c("#sort-buttons span a").toggle();c("a.describe-toggle-on").show();c("a.describe-toggle-off, table.slidetoggle").hide();c("img.pinkynail").toggle(true);return false});e();clearAll();if(c("#media-items>*").length>1){a=wpgallery.getWin();c("#save-all, #gallery-settings").show();if(typeof a.tinyMCE!="undefined"&&a.tinyMCE.activeEditor&&!a.tinyMCE.activeEditor.isHidden()){wpgallery.mcemode=true;wpgallery.init()}else{c("#insert-gallery").show()}}});jQuery(window).unload(function(){tinymce=tinyMCE=wpgallery=null});var tinymce=null,tinyMCE,wpgallery;wpgallery={mcemode:false,editor:{},dom:{},is_update:false,el:{},I:function(a){return document.getElementById(a)},init:function(){var d=this,a,f,c,e,b=d.getWin();if(!d.mcemode){return}a=(""+document.location.search).replace(/^\?/,"").split("&");f={};for(c=0;c<a.length;c++){e=a[c].split("=");f[unescape(e[0])]=unescape(e[1])}if(f.mce_rdomain){document.domain=f.mce_rdomain}tinymce=b.tinymce;tinyMCE=b.tinyMCE;d.editor=tinymce.EditorManager.activeEditor;d.setup()},getWin:function(){return window.dialogArguments||opener||parent||top},setup:function(){var f=this,c,d=f.editor,i,e,h,b,j;if(!f.mcemode){return}f.el=d.selection.getNode();if(f.el.nodeName!="IMG"||!d.dom.hasClass(f.el,"wpGallery")){if((i=d.dom.select("img.wpGallery"))&&i[0]){f.el=i[0]}else{if(getUserSetting("galfile")=="1"){f.I("linkto-file").checked="checked"}if(getUserSetting("galdesc")=="1"){f.I("order-desc").checked="checked"}if(getUserSetting("galcols")){f.I("columns").value=getUserSetting("galcols")}if(getUserSetting("galord")){f.I("orderby").value=getUserSetting("galord")}jQuery("#insert-gallery").show();return}}c=d.dom.getAttrib(f.el,"title");c=d.dom.decode(c);if(c){jQuery("#update-gallery").show();f.is_update=true;e=c.match(/columns=['"]([0-9]+)['"]/);h=c.match(/link=['"]([^'"]+)['"]/i);b=c.match(/order=['"]([^'"]+)['"]/i);j=c.match(/orderby=['"]([^'"]+)['"]/i);if(h&&h[1]){f.I("linkto-file").checked="checked"}if(b&&b[1]){f.I("order-desc").checked="checked"}if(e&&e[1]){f.I("columns").value=""+e[1]}if(j&&j[1]){f.I("orderby").value=j[1]}}else{jQuery("#insert-gallery").show()}},update:function(){var b=this,a=b.editor,d="",c;if(!b.mcemode||!b.is_update){c="[gallery"+b.getSettings()+"]";b.getWin().send_to_editor(c);return}if(b.el.nodeName!="IMG"){return}d=a.dom.decode(a.dom.getAttrib(b.el,"title"));d=d.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,"");d+=b.getSettings();a.dom.setAttrib(b.el,"title",d);b.getWin().tb_remove()},getSettings:function(){var a=this.I,b="";if(a("linkto-file").checked){b+=' link="file"';setUserSetting("galfile","1")}if(a("order-desc").checked){b+=' order="DESC"';setUserSetting("galdesc","1")}if(a("columns").value!=3){b+=' columns="'+a("columns").value+'"';setUserSetting("galcols",a("columns").value)}if(a("orderby").value!="menu_order"){b+=' orderby="'+a("orderby").value+'"';setUserSetting("galord",a("orderby").value)}return b}};
|
||||
jQuery(document).ready(function($) {
|
||||
var gallerySortable, gallerySortableInit, w, desc = false;
|
||||
|
||||
gallerySortableInit = function() {
|
||||
gallerySortable = $('#media-items').sortable( {
|
||||
items: 'div.media-item',
|
||||
placeholder: 'sorthelper',
|
||||
axis: 'y',
|
||||
distance: 2,
|
||||
handle: 'div.filename',
|
||||
stop: function(e, ui) {
|
||||
// When an update has occurred, adjust the order for each item
|
||||
var all = $('#media-items').sortable('toArray'), len = all.length;
|
||||
$.each(all, function(i, id) {
|
||||
var order = desc ? (len - i) : (1 + i);
|
||||
$('#' + id + ' .menu_order input').val(order);
|
||||
});
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
sortIt = function() {
|
||||
var all = $('.menu_order_input'), len = all.length;
|
||||
all.each(function(i){
|
||||
var order = desc ? (len - i) : (1 + i);
|
||||
$(this).val(order);
|
||||
});
|
||||
}
|
||||
|
||||
clearAll = function(c) {
|
||||
c = c || 0;
|
||||
$('.menu_order_input').each(function(){
|
||||
if ( this.value == '0' || c ) this.value = '';
|
||||
});
|
||||
}
|
||||
|
||||
$('#asc').click(function(){desc = false; sortIt(); return false;});
|
||||
$('#desc').click(function(){desc = true; sortIt(); return false;});
|
||||
$('#clear').click(function(){clearAll(1); return false;});
|
||||
$('#showall').click(function(){
|
||||
$('#sort-buttons span a').toggle();
|
||||
$('a.describe-toggle-on').hide();
|
||||
$('a.describe-toggle-off, table.slidetoggle').show();
|
||||
$('img.pinkynail').toggle(false);
|
||||
return false;
|
||||
});
|
||||
$('#hideall').click(function(){
|
||||
$('#sort-buttons span a').toggle();
|
||||
$('a.describe-toggle-on').show();
|
||||
$('a.describe-toggle-off, table.slidetoggle').hide();
|
||||
$('img.pinkynail').toggle(true);
|
||||
return false;
|
||||
});
|
||||
|
||||
// initialize sortable
|
||||
gallerySortableInit();
|
||||
clearAll();
|
||||
|
||||
if ( $('#media-items>*').length > 1 ) {
|
||||
w = wpgallery.getWin();
|
||||
|
||||
$('#save-all, #gallery-settings').show();
|
||||
if ( typeof w.tinyMCE != 'undefined' && w.tinyMCE.activeEditor && ! w.tinyMCE.activeEditor.isHidden() ) {
|
||||
wpgallery.mcemode = true;
|
||||
wpgallery.init();
|
||||
} else {
|
||||
$('#insert-gallery').show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(window).unload( function () { tinymce = tinyMCE = wpgallery = null; } ); // Cleanup
|
||||
|
||||
/* gallery settings */
|
||||
var tinymce = null, tinyMCE, wpgallery;
|
||||
|
||||
wpgallery = {
|
||||
mcemode : false,
|
||||
editor : {},
|
||||
dom : {},
|
||||
is_update : false,
|
||||
el : {},
|
||||
|
||||
I : function(e) {
|
||||
return document.getElementById(e);
|
||||
},
|
||||
|
||||
init: function() {
|
||||
var t = this, li, q, i, it, w = t.getWin();
|
||||
|
||||
if ( ! t.mcemode ) return;
|
||||
|
||||
li = ('' + document.location.search).replace(/^\?/, '').split('&');
|
||||
q = {};
|
||||
for (i=0; i<li.length; i++) {
|
||||
it = li[i].split('=');
|
||||
q[unescape(it[0])] = unescape(it[1]);
|
||||
}
|
||||
|
||||
if (q.mce_rdomain)
|
||||
document.domain = q.mce_rdomain;
|
||||
|
||||
// Find window & API
|
||||
tinymce = w.tinymce;
|
||||
tinyMCE = w.tinyMCE;
|
||||
t.editor = tinymce.EditorManager.activeEditor;
|
||||
|
||||
t.setup();
|
||||
},
|
||||
|
||||
getWin : function() {
|
||||
return window.dialogArguments || opener || parent || top;
|
||||
},
|
||||
|
||||
setup : function() {
|
||||
var t = this, a, ed = t.editor, g, columns, link, order, orderby;
|
||||
if ( ! t.mcemode ) return;
|
||||
|
||||
t.el = ed.selection.getNode();
|
||||
|
||||
if ( t.el.nodeName != 'IMG' || ! ed.dom.hasClass(t.el, 'wpGallery') ) {
|
||||
if ( (g = ed.dom.select('img.wpGallery')) && g[0] ) {
|
||||
t.el = g[0];
|
||||
} else {
|
||||
if ( getUserSetting('galfile') == '1' ) t.I('linkto-file').checked = "checked";
|
||||
if ( getUserSetting('galdesc') == '1' ) t.I('order-desc').checked = "checked";
|
||||
if ( getUserSetting('galcols') ) t.I('columns').value = getUserSetting('galcols');
|
||||
if ( getUserSetting('galord') ) t.I('orderby').value = getUserSetting('galord');
|
||||
jQuery('#insert-gallery').show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
a = ed.dom.getAttrib(t.el, 'title');
|
||||
a = ed.dom.decode(a);
|
||||
|
||||
if ( a ) {
|
||||
jQuery('#update-gallery').show();
|
||||
t.is_update = true;
|
||||
|
||||
columns = a.match(/columns=['"]([0-9]+)['"]/);
|
||||
link = a.match(/link=['"]([^'"]+)['"]/i);
|
||||
order = a.match(/order=['"]([^'"]+)['"]/i);
|
||||
orderby = a.match(/orderby=['"]([^'"]+)['"]/i);
|
||||
|
||||
if ( link && link[1] ) t.I('linkto-file').checked = "checked";
|
||||
if ( order && order[1] ) t.I('order-desc').checked = "checked";
|
||||
if ( columns && columns[1] ) t.I('columns').value = ''+columns[1];
|
||||
if ( orderby && orderby[1] ) t.I('orderby').value = orderby[1];
|
||||
} else {
|
||||
jQuery('#insert-gallery').show();
|
||||
}
|
||||
},
|
||||
|
||||
update : function() {
|
||||
var t = this, ed = t.editor, all = '', s;
|
||||
|
||||
if ( ! t.mcemode || ! t.is_update ) {
|
||||
s = '[gallery'+t.getSettings()+']';
|
||||
t.getWin().send_to_editor(s);
|
||||
return;
|
||||
}
|
||||
|
||||
if (t.el.nodeName != 'IMG') return;
|
||||
|
||||
all = ed.dom.decode(ed.dom.getAttrib(t.el, 'title'));
|
||||
all = all.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi, '');
|
||||
all += t.getSettings();
|
||||
|
||||
ed.dom.setAttrib(t.el, 'title', all);
|
||||
t.getWin().tb_remove();
|
||||
},
|
||||
|
||||
getSettings : function() {
|
||||
var I = this.I, s = '';
|
||||
|
||||
if ( I('linkto-file').checked ) {
|
||||
s += ' link="file"';
|
||||
setUserSetting('galfile', '1');
|
||||
}
|
||||
|
||||
if ( I('order-desc').checked ) {
|
||||
s += ' order="DESC"';
|
||||
setUserSetting('galdesc', '1');
|
||||
}
|
||||
|
||||
if ( I('columns').value != 3 ) {
|
||||
s += ' columns="'+I('columns').value+'"';
|
||||
setUserSetting('galcols', I('columns').value);
|
||||
}
|
||||
|
||||
if ( I('orderby').value != 'menu_order' ) {
|
||||
s += ' orderby="'+I('orderby').value+'"';
|
||||
setUserSetting('galord', I('orderby').value);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
jQuery(document).ready(function(c){var b,e,a,d=false;e=function(){b=c("#media-items").sortable({items:"div.media-item",placeholder:"sorthelper",axis:"y",distance:2,handle:"div.filename",stop:function(i,h){var g=c("#media-items").sortable("toArray"),f=g.length;c.each(g,function(k,l){var j=d?(f-k):(1+k);c("#"+l+" .menu_order input").val(j)})}})};sortIt=function(){var g=c(".menu_order_input"),f=g.length;g.each(function(j){var h=d?(f-j):(1+j);c(this).val(h)})};clearAll=function(f){f=f||0;c(".menu_order_input").each(function(){if(this.value=="0"||f){this.value=""}})};c("#asc").click(function(){d=false;sortIt();return false});c("#desc").click(function(){d=true;sortIt();return false});c("#clear").click(function(){clearAll(1);return false});c("#showall").click(function(){c("#sort-buttons span a").toggle();c("a.describe-toggle-on").hide();c("a.describe-toggle-off, table.slidetoggle").show();c("img.pinkynail").toggle(false);return false});c("#hideall").click(function(){c("#sort-buttons span a").toggle();c("a.describe-toggle-on").show();c("a.describe-toggle-off, table.slidetoggle").hide();c("img.pinkynail").toggle(true);return false});e();clearAll();if(c("#media-items>*").length>1){a=wpgallery.getWin();c("#save-all, #gallery-settings").show();if(typeof a.tinyMCE!="undefined"&&a.tinyMCE.activeEditor&&!a.tinyMCE.activeEditor.isHidden()){wpgallery.mcemode=true;wpgallery.init()}else{c("#insert-gallery").show()}}});jQuery(window).unload(function(){tinymce=tinyMCE=wpgallery=null});var tinymce=null,tinyMCE,wpgallery;wpgallery={mcemode:false,editor:{},dom:{},is_update:false,el:{},I:function(a){return document.getElementById(a)},init:function(){var d=this,a,f,c,e,b=d.getWin();if(!d.mcemode){return}a=(""+document.location.search).replace(/^\?/,"").split("&");f={};for(c=0;c<a.length;c++){e=a[c].split("=");f[unescape(e[0])]=unescape(e[1])}if(f.mce_rdomain){document.domain=f.mce_rdomain}tinymce=b.tinymce;tinyMCE=b.tinyMCE;d.editor=tinymce.EditorManager.activeEditor;d.setup()},getWin:function(){return window.dialogArguments||opener||parent||top},setup:function(){var f=this,c,d=f.editor,i,e,h,b,j;if(!f.mcemode){return}f.el=d.selection.getNode();if(f.el.nodeName!="IMG"||!d.dom.hasClass(f.el,"wpGallery")){if((i=d.dom.select("img.wpGallery"))&&i[0]){f.el=i[0]}else{if(getUserSetting("galfile")=="1"){f.I("linkto-file").checked="checked"}if(getUserSetting("galdesc")=="1"){f.I("order-desc").checked="checked"}if(getUserSetting("galcols")){f.I("columns").value=getUserSetting("galcols")}if(getUserSetting("galord")){f.I("orderby").value=getUserSetting("galord")}jQuery("#insert-gallery").show();return}}c=d.dom.getAttrib(f.el,"title");c=d.dom.decode(c);if(c){jQuery("#update-gallery").show();f.is_update=true;e=c.match(/columns=['"]([0-9]+)['"]/);h=c.match(/link=['"]([^'"]+)['"]/i);b=c.match(/order=['"]([^'"]+)['"]/i);j=c.match(/orderby=['"]([^'"]+)['"]/i);if(h&&h[1]){f.I("linkto-file").checked="checked"}if(b&&b[1]){f.I("order-desc").checked="checked"}if(e&&e[1]){f.I("columns").value=""+e[1]}if(j&&j[1]){f.I("orderby").value=j[1]}}else{jQuery("#insert-gallery").show()}},update:function(){var b=this,a=b.editor,d="",c;if(!b.mcemode||!b.is_update){c="[gallery"+b.getSettings()+"]";b.getWin().send_to_editor(c);return}if(b.el.nodeName!="IMG"){return}d=a.dom.decode(a.dom.getAttrib(b.el,"title"));d=d.replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,"");d+=b.getSettings();a.dom.setAttrib(b.el,"title",d);b.getWin().tb_remove()},getSettings:function(){var a=this.I,b="";if(a("linkto-file").checked){b+=' link="file"';setUserSetting("galfile","1")}if(a("order-desc").checked){b+=' order="DESC"';setUserSetting("galdesc","1")}if(a("columns").value!=3){b+=' columns="'+a("columns").value+'"';setUserSetting("galcols",a("columns").value)}if(a("orderby").value!="menu_order"){b+=' orderby="'+a("orderby").value+'"';setUserSetting("galord",a("orderby").value)}return b}};
|
|
@ -1,572 +0,0 @@
|
|||
var imageEdit;
|
||||
|
||||
(function($) {
|
||||
imageEdit = {
|
||||
iasapi : {},
|
||||
hold : {},
|
||||
postid : '',
|
||||
|
||||
intval : function(f) {
|
||||
return f | 0;
|
||||
},
|
||||
|
||||
setDisabled : function(el, s) {
|
||||
if ( s ) {
|
||||
el.removeClass('disabled');
|
||||
$('input', el).removeAttr('disabled');
|
||||
} else {
|
||||
el.addClass('disabled');
|
||||
$('input', el).prop('disabled', true);
|
||||
}
|
||||
},
|
||||
|
||||
init : function(postid, nonce) {
|
||||
var t = this, old = $('#image-editor-' + t.postid),
|
||||
x = t.intval( $('#imgedit-x-' + postid).val() ),
|
||||
y = t.intval( $('#imgedit-y-' + postid).val() );
|
||||
|
||||
if ( t.postid != postid && old.length )
|
||||
t.close(t.postid);
|
||||
|
||||
t.hold['w'] = t.hold['ow'] = x;
|
||||
t.hold['h'] = t.hold['oh'] = y;
|
||||
t.hold['xy_ratio'] = x / y;
|
||||
t.hold['sizer'] = parseFloat( $('#imgedit-sizer-' + postid).val() );
|
||||
t.postid = postid;
|
||||
$('#imgedit-response-' + postid).empty();
|
||||
|
||||
$('input[type="text"]', '#imgedit-panel-' + postid).keypress(function(e) {
|
||||
var k = e.keyCode;
|
||||
|
||||
if ( 36 < k && k < 41 )
|
||||
$(this).blur()
|
||||
|
||||
if ( 13 == k ) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
toggleEditor : function(postid, toggle) {
|
||||
var wait = $('#imgedit-wait-' + postid);
|
||||
|
||||
if ( toggle )
|
||||
wait.height( $('#imgedit-panel-' + postid).height() ).fadeIn('fast');
|
||||
else
|
||||
wait.fadeOut('fast');
|
||||
},
|
||||
|
||||
toggleHelp : function(el) {
|
||||
$(el).siblings('.imgedit-help').slideToggle('fast');
|
||||
return false;
|
||||
},
|
||||
|
||||
getTarget : function(postid) {
|
||||
return $('input[name="imgedit-target-' + postid + '"]:checked', '#imgedit-save-target-' + postid).val() || 'full';
|
||||
},
|
||||
|
||||
scaleChanged : function(postid, x) {
|
||||
var w = $('#imgedit-scale-width-' + postid), h = $('#imgedit-scale-height-' + postid),
|
||||
warn = $('#imgedit-scale-warn-' + postid), w1 = '', h1 = '';
|
||||
|
||||
if ( x ) {
|
||||
h1 = (w.val() != '') ? this.intval( w.val() / this.hold['xy_ratio'] ) : '';
|
||||
h.val( h1 );
|
||||
} else {
|
||||
w1 = (h.val() != '') ? this.intval( h.val() * this.hold['xy_ratio'] ) : '';
|
||||
w.val( w1 );
|
||||
}
|
||||
|
||||
if ( ( h1 && h1 > this.hold['oh'] ) || ( w1 && w1 > this.hold['ow'] ) )
|
||||
warn.css('visibility', 'visible');
|
||||
else
|
||||
warn.css('visibility', 'hidden');
|
||||
},
|
||||
|
||||
getSelRatio : function(postid) {
|
||||
var x = this.hold['w'], y = this.hold['h'],
|
||||
X = this.intval( $('#imgedit-crop-width-' + postid).val() ),
|
||||
Y = this.intval( $('#imgedit-crop-height-' + postid).val() );
|
||||
|
||||
if ( X && Y )
|
||||
return X + ':' + Y;
|
||||
|
||||
if ( x && y )
|
||||
return x + ':' + y;
|
||||
|
||||
return '1:1';
|
||||
},
|
||||
|
||||
filterHistory : function(postid, setSize) {
|
||||
// apply undo state to history
|
||||
var history = $('#imgedit-history-' + postid).val(), pop, n, o, i, op = [];
|
||||
|
||||
if ( history != '' ) {
|
||||
history = JSON.parse(history);
|
||||
pop = this.intval( $('#imgedit-undone-' + postid).val() );
|
||||
if ( pop > 0 ) {
|
||||
while ( pop > 0 ) {
|
||||
history.pop();
|
||||
pop--;
|
||||
}
|
||||
}
|
||||
|
||||
if ( setSize ) {
|
||||
if ( !history.length ) {
|
||||
this.hold['w'] = this.hold['ow'];
|
||||
this.hold['h'] = this.hold['oh'];
|
||||
return '';
|
||||
}
|
||||
|
||||
// restore
|
||||
o = history[history.length - 1];
|
||||
o = o.c || o.r || o.f || false;
|
||||
|
||||
if ( o ) {
|
||||
this.hold['w'] = o.fw;
|
||||
this.hold['h'] = o.fh;
|
||||
}
|
||||
}
|
||||
|
||||
// filter the values
|
||||
for ( n in history ) {
|
||||
i = history[n];
|
||||
if ( i.hasOwnProperty('c') ) {
|
||||
op[n] = { 'c': { 'x': i.c.x, 'y': i.c.y, 'w': i.c.w, 'h': i.c.h } };
|
||||
} else if ( i.hasOwnProperty('r') ) {
|
||||
op[n] = { 'r': i.r.r };
|
||||
} else if ( i.hasOwnProperty('f') ) {
|
||||
op[n] = { 'f': i.f.f };
|
||||
}
|
||||
}
|
||||
return JSON.stringify(op);
|
||||
}
|
||||
return '';
|
||||
},
|
||||
|
||||
refreshEditor : function(postid, nonce, callback) {
|
||||
var t = this, data, img;
|
||||
|
||||
t.toggleEditor(postid, 1);
|
||||
data = {
|
||||
'action': 'imgedit-preview',
|
||||
'_ajax_nonce': nonce,
|
||||
'postid': postid,
|
||||
'history': t.filterHistory(postid, 1),
|
||||
'rand': t.intval(Math.random() * 1000000)
|
||||
};
|
||||
|
||||
img = $('<img id="image-preview-' + postid + '" />');
|
||||
img.load( function() {
|
||||
var max1, max2, parent = $('#imgedit-crop-' + postid), t = imageEdit;
|
||||
|
||||
parent.empty().append(img);
|
||||
|
||||
// w, h are the new full size dims
|
||||
max1 = Math.max( t.hold.w, t.hold.h );
|
||||
max2 = Math.max( $(img).width(), $(img).height() );
|
||||
t.hold['sizer'] = max1 > max2 ? max2 / max1 : 1;
|
||||
|
||||
t.initCrop(postid, img, parent);
|
||||
t.setCropSelection(postid, 0);
|
||||
|
||||
if ( (typeof callback != "unknown") && callback != null )
|
||||
callback();
|
||||
|
||||
if ( $('#imgedit-history-' + postid).val() && $('#imgedit-undone-' + postid).val() == 0 )
|
||||
$('input.imgedit-submit-btn', '#imgedit-panel-' + postid).removeAttr('disabled');
|
||||
else
|
||||
$('input.imgedit-submit-btn', '#imgedit-panel-' + postid).prop('disabled', true);
|
||||
|
||||
t.toggleEditor(postid, 0);
|
||||
}).error(function(){
|
||||
$('#imgedit-crop-' + postid).empty().append('<div class="error"><p>' + imageEditL10n.error + '</p></div>');
|
||||
t.toggleEditor(postid, 0);
|
||||
}).attr('src', ajaxurl + '?' + $.param(data));
|
||||
},
|
||||
|
||||
action : function(postid, nonce, action) {
|
||||
var t = this, data, w, h, fw, fh;
|
||||
|
||||
if ( t.notsaved(postid) )
|
||||
return false;
|
||||
|
||||
data = {
|
||||
'action': 'image-editor',
|
||||
'_ajax_nonce': nonce,
|
||||
'postid': postid
|
||||
};
|
||||
|
||||
if ( 'scale' == action ) {
|
||||
w = $('#imgedit-scale-width-' + postid),
|
||||
h = $('#imgedit-scale-height-' + postid),
|
||||
fw = t.intval(w.val()),
|
||||
fh = t.intval(h.val());
|
||||
|
||||
if ( fw < 1 ) {
|
||||
w.focus();
|
||||
return false;
|
||||
} else if ( fh < 1 ) {
|
||||
h.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( fw == t.hold.ow || fh == t.hold.oh )
|
||||
return false;
|
||||
|
||||
data['do'] = 'scale';
|
||||
data['fwidth'] = fw;
|
||||
data['fheight'] = fh;
|
||||
} else if ( 'restore' == action ) {
|
||||
data['do'] = 'restore';
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
t.toggleEditor(postid, 1);
|
||||
$.post(ajaxurl, data, function(r) {
|
||||
$('#image-editor-' + postid).empty().append(r);
|
||||
t.toggleEditor(postid, 0);
|
||||
});
|
||||
},
|
||||
|
||||
save : function(postid, nonce) {
|
||||
var data, target = this.getTarget(postid), history = this.filterHistory(postid, 0);
|
||||
|
||||
if ( '' == history )
|
||||
return false;
|
||||
|
||||
this.toggleEditor(postid, 1);
|
||||
data = {
|
||||
'action': 'image-editor',
|
||||
'_ajax_nonce': nonce,
|
||||
'postid': postid,
|
||||
'history': history,
|
||||
'target': target,
|
||||
'do': 'save'
|
||||
};
|
||||
|
||||
$.post(ajaxurl, data, function(r) {
|
||||
var ret = JSON.parse(r);
|
||||
|
||||
if ( ret.error ) {
|
||||
$('#imgedit-response-' + postid).html('<div class="error"><p>' + ret.error + '</p><div>');
|
||||
imageEdit.close(postid);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ret.fw && ret.fh )
|
||||
$('#media-dims-' + postid).html( ret.fw + ' × ' + ret.fh );
|
||||
|
||||
if ( ret.thumbnail )
|
||||
$('.thumbnail', '#thumbnail-head-' + postid).attr('src', ''+ret.thumbnail);
|
||||
|
||||
if ( ret.msg )
|
||||
$('#imgedit-response-' + postid).html('<div class="updated"><p>' + ret.msg + '</p></div>');
|
||||
|
||||
imageEdit.close(postid);
|
||||
});
|
||||
},
|
||||
|
||||
open : function(postid, nonce) {
|
||||
var data, elem = $('#image-editor-' + postid), head = $('#media-head-' + postid),
|
||||
btn = $('#imgedit-open-btn-' + postid), spin = btn.siblings('img');
|
||||
|
||||
btn.prop('disabled', true);
|
||||
spin.css('visibility', 'visible');
|
||||
|
||||
data = {
|
||||
'action': 'image-editor',
|
||||
'_ajax_nonce': nonce,
|
||||
'postid': postid,
|
||||
'do': 'open'
|
||||
};
|
||||
|
||||
elem.load(ajaxurl, data, function() {
|
||||
elem.fadeIn('fast');
|
||||
head.fadeOut('fast', function(){
|
||||
btn.removeAttr('disabled');
|
||||
spin.css('visibility', 'hidden');
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
imgLoaded : function(postid) {
|
||||
var img = $('#image-preview-' + postid), parent = $('#imgedit-crop-' + postid);
|
||||
|
||||
this.initCrop(postid, img, parent);
|
||||
this.setCropSelection(postid, 0);
|
||||
this.toggleEditor(postid, 0);
|
||||
},
|
||||
|
||||
initCrop : function(postid, image, parent) {
|
||||
var t = this, selW = $('#imgedit-sel-width-' + postid),
|
||||
selH = $('#imgedit-sel-height-' + postid);
|
||||
|
||||
t.iasapi = $(image).imgAreaSelect({
|
||||
parent: parent,
|
||||
instance: true,
|
||||
handles: true,
|
||||
keys: true,
|
||||
minWidth: 3,
|
||||
minHeight: 3,
|
||||
|
||||
onInit: function(img, c) {
|
||||
parent.children().mousedown(function(e){
|
||||
var ratio = false, sel, defRatio;
|
||||
|
||||
if ( e.shiftKey ) {
|
||||
sel = t.iasapi.getSelection();
|
||||
defRatio = t.getSelRatio(postid);
|
||||
ratio = ( sel && sel.width && sel.height ) ? sel.width + ':' + sel.height : defRatio;
|
||||
}
|
||||
|
||||
t.iasapi.setOptions({
|
||||
aspectRatio: ratio
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onSelectStart: function(img, c) {
|
||||
imageEdit.setDisabled($('#imgedit-crop-sel-' + postid), 1);
|
||||
},
|
||||
|
||||
onSelectEnd: function(img, c) {
|
||||
imageEdit.setCropSelection(postid, c);
|
||||
},
|
||||
|
||||
onSelectChange: function(img, c) {
|
||||
var sizer = imageEdit.hold.sizer;
|
||||
selW.val( imageEdit.round(c.width / sizer) );
|
||||
selH.val( imageEdit.round(c.height / sizer) );
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
setCropSelection : function(postid, c) {
|
||||
var sel, min = $('#imgedit-minthumb-' + postid).val() || '128:128',
|
||||
sizer = this.hold['sizer'];
|
||||
min = min.split(':');
|
||||
c = c || 0;
|
||||
|
||||
if ( !c || ( c.width < 3 && c.height < 3 ) ) {
|
||||
this.setDisabled($('.imgedit-crop', '#imgedit-panel-' + postid), 0);
|
||||
this.setDisabled($('#imgedit-crop-sel-' + postid), 0);
|
||||
$('#imgedit-sel-width-' + postid).val('');
|
||||
$('#imgedit-sel-height-' + postid).val('');
|
||||
$('#imgedit-selection-' + postid).val('');
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( c.width < (min[0] * sizer) && c.height < (min[1] * sizer) ) {
|
||||
this.setDisabled($('.imgedit-crop', '#imgedit-panel-' + postid), 0);
|
||||
$('#imgedit-selection-' + postid).val('');
|
||||
return false;
|
||||
}
|
||||
|
||||
sel = { 'x': c.x1, 'y': c.y1, 'w': c.width, 'h': c.height };
|
||||
this.setDisabled($('.imgedit-crop', '#imgedit-panel-' + postid), 1);
|
||||
$('#imgedit-selection-' + postid).val( JSON.stringify(sel) );
|
||||
},
|
||||
|
||||
close : function(postid, warn) {
|
||||
warn = warn || false;
|
||||
|
||||
if ( warn && this.notsaved(postid) )
|
||||
return false;
|
||||
|
||||
this.iasapi = {};
|
||||
this.hold = {};
|
||||
$('#image-editor-' + postid).fadeOut('fast', function() {
|
||||
$('#media-head-' + postid).fadeIn('fast');
|
||||
$(this).empty();
|
||||
});
|
||||
},
|
||||
|
||||
notsaved : function(postid) {
|
||||
var h = $('#imgedit-history-' + postid).val(),
|
||||
history = (h != '') ? JSON.parse(h) : new Array(),
|
||||
pop = this.intval( $('#imgedit-undone-' + postid).val() );
|
||||
|
||||
if ( pop < history.length ) {
|
||||
if ( confirm( $('#imgedit-leaving-' + postid).html() ) )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
addStep : function(op, postid, nonce) {
|
||||
var t = this, elem = $('#imgedit-history-' + postid),
|
||||
history = (elem.val() != '') ? JSON.parse(elem.val()) : new Array(),
|
||||
undone = $('#imgedit-undone-' + postid),
|
||||
pop = t.intval(undone.val());
|
||||
|
||||
while ( pop > 0 ) {
|
||||
history.pop();
|
||||
pop--;
|
||||
}
|
||||
undone.val(0); // reset
|
||||
|
||||
history.push(op);
|
||||
elem.val( JSON.stringify(history) );
|
||||
|
||||
t.refreshEditor(postid, nonce, function() {
|
||||
t.setDisabled($('#image-undo-' + postid), true);
|
||||
t.setDisabled($('#image-redo-' + postid), false);
|
||||
});
|
||||
},
|
||||
|
||||
rotate : function(angle, postid, nonce, t) {
|
||||
if ( $(t).hasClass('disabled') )
|
||||
return false;
|
||||
|
||||
this.addStep({ 'r': { 'r': angle, 'fw': this.hold['h'], 'fh': this.hold['w'] }}, postid, nonce);
|
||||
},
|
||||
|
||||
flip : function (axis, postid, nonce, t) {
|
||||
if ( $(t).hasClass('disabled') )
|
||||
return false;
|
||||
|
||||
this.addStep({ 'f': { 'f': axis, 'fw': this.hold['w'], 'fh': this.hold['h'] }}, postid, nonce);
|
||||
},
|
||||
|
||||
crop : function (postid, nonce, t) {
|
||||
var sel = $('#imgedit-selection-' + postid).val(),
|
||||
w = this.intval( $('#imgedit-sel-width-' + postid).val() ),
|
||||
h = this.intval( $('#imgedit-sel-height-' + postid).val() );
|
||||
|
||||
if ( $(t).hasClass('disabled') || sel == '' )
|
||||
return false;
|
||||
|
||||
sel = JSON.parse(sel);
|
||||
if ( sel.w > 0 && sel.h > 0 && w > 0 && h > 0 ) {
|
||||
sel['fw'] = w;
|
||||
sel['fh'] = h;
|
||||
this.addStep({ 'c': sel }, postid, nonce);
|
||||
}
|
||||
},
|
||||
|
||||
undo : function (postid, nonce) {
|
||||
var t = this, button = $('#image-undo-' + postid), elem = $('#imgedit-undone-' + postid),
|
||||
pop = t.intval( elem.val() ) + 1;
|
||||
|
||||
if ( button.hasClass('disabled') )
|
||||
return;
|
||||
|
||||
elem.val(pop);
|
||||
t.refreshEditor(postid, nonce, function() {
|
||||
var elem = $('#imgedit-history-' + postid),
|
||||
history = (elem.val() != '') ? JSON.parse(elem.val()) : new Array();
|
||||
|
||||
t.setDisabled($('#image-redo-' + postid), true);
|
||||
t.setDisabled(button, pop < history.length);
|
||||
});
|
||||
},
|
||||
|
||||
redo : function(postid, nonce) {
|
||||
var t = this, button = $('#image-redo-' + postid), elem = $('#imgedit-undone-' + postid),
|
||||
pop = t.intval( elem.val() ) - 1;
|
||||
|
||||
if ( button.hasClass('disabled') )
|
||||
return;
|
||||
|
||||
elem.val(pop);
|
||||
t.refreshEditor(postid, nonce, function() {
|
||||
t.setDisabled($('#image-undo-' + postid), true);
|
||||
t.setDisabled(button, pop > 0);
|
||||
});
|
||||
},
|
||||
|
||||
setNumSelection : function(postid) {
|
||||
var sel, elX = $('#imgedit-sel-width-' + postid), elY = $('#imgedit-sel-height-' + postid),
|
||||
x = this.intval( elX.val() ), y = this.intval( elY.val() ),
|
||||
img = $('#image-preview-' + postid), imgh = img.height(), imgw = img.width(),
|
||||
sizer = this.hold['sizer'], x1, y1, x2, y2, ias = this.iasapi;
|
||||
|
||||
if ( x < 1 ) {
|
||||
elX.val('');
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( y < 1 ) {
|
||||
elY.val('');
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( x && y && ( sel = ias.getSelection() ) ) {
|
||||
x2 = sel.x1 + Math.round( x * sizer );
|
||||
y2 = sel.y1 + Math.round( y * sizer );
|
||||
x1 = sel.x1;
|
||||
y1 = sel.y1;
|
||||
|
||||
if ( x2 > imgw ) {
|
||||
x1 = 0;
|
||||
x2 = imgw;
|
||||
elX.val( Math.round( x2 / sizer ) );
|
||||
}
|
||||
|
||||
if ( y2 > imgh ) {
|
||||
y1 = 0;
|
||||
y2 = imgh;
|
||||
elY.val( Math.round( y2 / sizer ) );
|
||||
}
|
||||
|
||||
ias.setSelection( x1, y1, x2, y2 );
|
||||
ias.update();
|
||||
this.setCropSelection(postid, ias.getSelection());
|
||||
}
|
||||
},
|
||||
|
||||
round : function(num) {
|
||||
var s;
|
||||
num = Math.round(num);
|
||||
|
||||
if ( this.hold.sizer > 0.6 )
|
||||
return num;
|
||||
|
||||
s = num.toString().slice(-1);
|
||||
|
||||
if ( '1' == s )
|
||||
return num - 1;
|
||||
else if ( '9' == s )
|
||||
return num + 1;
|
||||
|
||||
return num;
|
||||
},
|
||||
|
||||
setRatioSelection : function(postid, n, el) {
|
||||
var sel, r, x = this.intval( $('#imgedit-crop-width-' + postid).val() ),
|
||||
y = this.intval( $('#imgedit-crop-height-' + postid).val() ),
|
||||
h = $('#image-preview-' + postid).height();
|
||||
|
||||
if ( !this.intval( $(el).val() ) ) {
|
||||
$(el).val('');
|
||||
return;
|
||||
}
|
||||
|
||||
if ( x && y ) {
|
||||
this.iasapi.setOptions({
|
||||
aspectRatio: x + ':' + y
|
||||
});
|
||||
|
||||
if ( sel = this.iasapi.getSelection(true) ) {
|
||||
r = Math.ceil( sel.y1 + ((sel.x2 - sel.x1) / (x / y)) );
|
||||
|
||||
if ( r > h ) {
|
||||
r = h;
|
||||
if ( n )
|
||||
$('#imgedit-crop-height-' + postid).val('');
|
||||
else
|
||||
$('#imgedit-crop-width-' + postid).val('');
|
||||
}
|
||||
|
||||
this.iasapi.setSelection( sel.x1, sel.y1, sel.x2, r );
|
||||
this.iasapi.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,303 +0,0 @@
|
|||
(function($) {
|
||||
inlineEditPost = {
|
||||
|
||||
init : function(){
|
||||
var t = this, qeRow = $('#inline-edit'), bulkRow = $('#bulk-edit');
|
||||
|
||||
t.type = $('table.widefat').hasClass('pages') ? 'page' : 'post';
|
||||
t.what = '#post-';
|
||||
|
||||
// prepare the edit rows
|
||||
qeRow.keyup(function(e){
|
||||
if (e.which == 27)
|
||||
return inlineEditPost.revert();
|
||||
});
|
||||
bulkRow.keyup(function(e){
|
||||
if (e.which == 27)
|
||||
return inlineEditPost.revert();
|
||||
});
|
||||
|
||||
$('a.cancel', qeRow).click(function(){
|
||||
return inlineEditPost.revert();
|
||||
});
|
||||
$('a.save', qeRow).click(function(){
|
||||
return inlineEditPost.save(this);
|
||||
});
|
||||
$('td', qeRow).keydown(function(e){
|
||||
if ( e.which == 13 )
|
||||
return inlineEditPost.save(this);
|
||||
});
|
||||
|
||||
$('a.cancel', bulkRow).click(function(){
|
||||
return inlineEditPost.revert();
|
||||
});
|
||||
|
||||
$('#inline-edit .inline-edit-private input[value="private"]').click( function(){
|
||||
var pw = $('input.inline-edit-password-input');
|
||||
if ( $(this).prop('checked') ) {
|
||||
pw.val('').prop('disabled', true);
|
||||
} else {
|
||||
pw.prop('disabled', false);
|
||||
}
|
||||
});
|
||||
|
||||
// add events
|
||||
$('a.editinline').live('click', function(){
|
||||
inlineEditPost.edit(this);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#bulk-title-div').parents('fieldset').after(
|
||||
$('#inline-edit fieldset.inline-edit-categories').clone()
|
||||
).siblings( 'fieldset:last' ).prepend(
|
||||
$('#inline-edit label.inline-edit-tags').clone()
|
||||
);
|
||||
|
||||
// hiearchical taxonomies expandable?
|
||||
$('span.catshow').click(function(){
|
||||
$(this).hide().next().show().parent().next().addClass("cat-hover");
|
||||
});
|
||||
|
||||
$('span.cathide').click(function(){
|
||||
$(this).hide().prev().show().parent().next().removeClass("cat-hover");
|
||||
});
|
||||
|
||||
$('select[name="_status"] option[value="future"]', bulkRow).remove();
|
||||
|
||||
$('#doaction, #doaction2').click(function(e){
|
||||
var n = $(this).attr('id').substr(2);
|
||||
if ( $('select[name="'+n+'"]').val() == 'edit' ) {
|
||||
e.preventDefault();
|
||||
t.setBulk();
|
||||
} else if ( $('form#posts-filter tr.inline-editor').length > 0 ) {
|
||||
t.revert();
|
||||
}
|
||||
});
|
||||
|
||||
$('#post-query-submit').mousedown(function(e){
|
||||
t.revert();
|
||||
$('select[name^="action"]').val('-1');
|
||||
});
|
||||
},
|
||||
|
||||
toggle : function(el){
|
||||
var t = this;
|
||||
$(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el);
|
||||
},
|
||||
|
||||
setBulk : function(){
|
||||
var te = '', type = this.type, tax, c = true;
|
||||
this.revert();
|
||||
|
||||
$('#bulk-edit td').attr('colspan', $('.widefat:first thead th:visible').length);
|
||||
$('table.widefat tbody').prepend( $('#bulk-edit') );
|
||||
$('#bulk-edit').addClass('inline-editor').show();
|
||||
|
||||
$('tbody th.check-column input[type="checkbox"]').each(function(i){
|
||||
if ( $(this).prop('checked') ) {
|
||||
c = false;
|
||||
var id = $(this).val(), theTitle;
|
||||
theTitle = $('#inline_'+id+' .post_title').text() || inlineEditL10n.notitle;
|
||||
te += '<div id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+theTitle+'</div>';
|
||||
}
|
||||
});
|
||||
|
||||
if ( c )
|
||||
return this.revert();
|
||||
|
||||
$('#bulk-titles').html(te);
|
||||
$('#bulk-titles a').click(function(){
|
||||
var id = $(this).attr('id').substr(1);
|
||||
|
||||
$('table.widefat input[value="' + id + '"]').prop('checked', false);
|
||||
$('#ttle'+id).remove();
|
||||
});
|
||||
|
||||
// enable autocomplete for tags
|
||||
if ( 'post' == type ) {
|
||||
// support multi taxonomies?
|
||||
tax = 'post_tag';
|
||||
$('tr.inline-editor textarea[name="tax_input['+tax+']"]').suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma + ' ' } );
|
||||
}
|
||||
$('html, body').animate( { scrollTop: 0 }, 'fast' );
|
||||
},
|
||||
|
||||
edit : function(id) {
|
||||
var t = this, fields, editRow, rowData, status, pageOpt, pageLevel, nextPage, pageLoop = true, nextLevel, cur_format, f;
|
||||
t.revert();
|
||||
|
||||
if ( typeof(id) == 'object' )
|
||||
id = t.getId(id);
|
||||
|
||||
fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'ss', 'post_password', 'post_format', 'menu_order'];
|
||||
if ( t.type == 'page' )
|
||||
fields.push('post_parent', 'page_template');
|
||||
|
||||
// add the new blank row
|
||||
editRow = $('#inline-edit').clone(true);
|
||||
$('td', editRow).attr('colspan', $('.widefat:first thead th:visible').length);
|
||||
|
||||
if ( $(t.what+id).hasClass('alternate') )
|
||||
$(editRow).addClass('alternate');
|
||||
$(t.what+id).hide().after(editRow);
|
||||
|
||||
// populate the data
|
||||
rowData = $('#inline_'+id);
|
||||
if ( !$(':input[name="post_author"] option[value="' + $('.post_author', rowData).text() + '"]', editRow).val() ) {
|
||||
// author no longer has edit caps, so we need to add them to the list of authors
|
||||
$(':input[name="post_author"]', editRow).prepend('<option value="' + $('.post_author', rowData).text() + '">' + $('#' + t.type + '-' + id + ' .author').text() + '</option>');
|
||||
}
|
||||
if ( $(':input[name="post_author"] option', editRow).length == 1 ) {
|
||||
$('label.inline-edit-author', editRow).hide();
|
||||
}
|
||||
|
||||
// hide unsupported formats, but leave the current format alone
|
||||
cur_format = $('.post_format', rowData).text();
|
||||
$('option.unsupported', editRow).each(function() {
|
||||
var $this = $(this);
|
||||
if ( $this.val() != cur_format )
|
||||
$this.remove();
|
||||
});
|
||||
|
||||
for ( f = 0; f < fields.length; f++ ) {
|
||||
$(':input[name="' + fields[f] + '"]', editRow).val( $('.'+fields[f], rowData).text() );
|
||||
}
|
||||
|
||||
if ( $('.comment_status', rowData).text() == 'open' )
|
||||
$('input[name="comment_status"]', editRow).prop("checked", true);
|
||||
if ( $('.ping_status', rowData).text() == 'open' )
|
||||
$('input[name="ping_status"]', editRow).prop("checked", true);
|
||||
if ( $('.sticky', rowData).text() == 'sticky' )
|
||||
$('input[name="sticky"]', editRow).prop("checked", true);
|
||||
|
||||
// hierarchical taxonomies
|
||||
$('.post_category', rowData).each(function(){
|
||||
var term_ids = $(this).text();
|
||||
|
||||
if ( term_ids ) {
|
||||
taxname = $(this).attr('id').replace('_'+id, '');
|
||||
$('ul.'+taxname+'-checklist :checkbox', editRow).val(term_ids.split(','));
|
||||
}
|
||||
});
|
||||
|
||||
//flat taxonomies
|
||||
$('.tags_input', rowData).each(function(){
|
||||
var terms = $(this).text(),
|
||||
taxname = $(this).attr('id').replace('_' + id, ''),
|
||||
textarea = $('textarea.tax_input_' + taxname, editRow),
|
||||
comma = inlineEditL10n.comma;
|
||||
|
||||
if ( terms ) {
|
||||
if ( ',' !== comma )
|
||||
terms = terms.replace(/,/g, comma);
|
||||
textarea.val(terms);
|
||||
}
|
||||
|
||||
textarea.suggest( ajaxurl + '?action=ajax-tag-search&tax=' + taxname, { delay: 500, minchars: 2, multiple: true, multipleSep: inlineEditL10n.comma + ' ' } );
|
||||
});
|
||||
|
||||
// handle the post status
|
||||
status = $('._status', rowData).text();
|
||||
if ( 'future' != status )
|
||||
$('select[name="_status"] option[value="future"]', editRow).remove();
|
||||
|
||||
if ( 'private' == status ) {
|
||||
$('input[name="keep_private"]', editRow).prop("checked", true);
|
||||
$('input.inline-edit-password-input').val('').prop('disabled', true);
|
||||
}
|
||||
|
||||
// remove the current page and children from the parent dropdown
|
||||
pageOpt = $('select[name="post_parent"] option[value="' + id + '"]', editRow);
|
||||
if ( pageOpt.length > 0 ) {
|
||||
pageLevel = pageOpt[0].className.split('-')[1];
|
||||
nextPage = pageOpt;
|
||||
while ( pageLoop ) {
|
||||
nextPage = nextPage.next('option');
|
||||
if (nextPage.length == 0) break;
|
||||
nextLevel = nextPage[0].className.split('-')[1];
|
||||
if ( nextLevel <= pageLevel ) {
|
||||
pageLoop = false;
|
||||
} else {
|
||||
nextPage.remove();
|
||||
nextPage = pageOpt;
|
||||
}
|
||||
}
|
||||
pageOpt.remove();
|
||||
}
|
||||
|
||||
$(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
|
||||
$('.ptitle', editRow).focus();
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
save : function(id) {
|
||||
var params, fields, page = $('.post_status_page').val() || '';
|
||||
|
||||
if ( typeof(id) == 'object' )
|
||||
id = this.getId(id);
|
||||
|
||||
$('table.widefat .inline-edit-save .waiting').show();
|
||||
|
||||
params = {
|
||||
action: 'inline-save',
|
||||
post_type: typenow,
|
||||
post_ID: id,
|
||||
edit_date: 'true',
|
||||
post_status: page
|
||||
};
|
||||
|
||||
fields = $('#edit-'+id+' :input').serialize();
|
||||
params = fields + '&' + $.param(params);
|
||||
|
||||
// make ajax request
|
||||
$.post( ajaxurl, params,
|
||||
function(r) {
|
||||
$('table.widefat .inline-edit-save .waiting').hide();
|
||||
|
||||
if (r) {
|
||||
if ( -1 != r.indexOf('<tr') ) {
|
||||
$(inlineEditPost.what+id).remove();
|
||||
$('#edit-'+id).before(r).remove();
|
||||
$(inlineEditPost.what+id).hide().fadeIn();
|
||||
} else {
|
||||
r = r.replace( /<.[^<>]*?>/g, '' );
|
||||
$('#edit-'+id+' .inline-edit-save .error').html(r).show();
|
||||
}
|
||||
} else {
|
||||
$('#edit-'+id+' .inline-edit-save .error').html(inlineEditL10n.error).show();
|
||||
}
|
||||
}
|
||||
, 'html');
|
||||
return false;
|
||||
},
|
||||
|
||||
revert : function(){
|
||||
var id = $('table.widefat tr.inline-editor').attr('id');
|
||||
|
||||
if ( id ) {
|
||||
$('table.widefat .inline-edit-save .waiting').hide();
|
||||
|
||||
if ( 'bulk-edit' == id ) {
|
||||
$('table.widefat #bulk-edit').removeClass('inline-editor').hide();
|
||||
$('#bulk-titles').html('');
|
||||
$('#inlineedit').append( $('#bulk-edit') );
|
||||
} else {
|
||||
$('#'+id).remove();
|
||||
id = id.substr( id.lastIndexOf('-') + 1 );
|
||||
$(this.what+id).show();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
getId : function(o) {
|
||||
var id = $(o).closest('tr').attr('id'),
|
||||
parts = id.split('-');
|
||||
return parts[parts.length - 1];
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function(){inlineEditPost.init();});
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,118 +0,0 @@
|
|||
|
||||
(function($) {
|
||||
inlineEditTax = {
|
||||
|
||||
init : function() {
|
||||
var t = this, row = $('#inline-edit');
|
||||
|
||||
t.type = $('#the-list').attr('class').substr(5);
|
||||
t.what = '#'+t.type+'-';
|
||||
|
||||
$('.editinline').live('click', function(){
|
||||
inlineEditTax.edit(this);
|
||||
return false;
|
||||
});
|
||||
|
||||
// prepare the edit row
|
||||
row.keyup(function(e) { if(e.which == 27) return inlineEditTax.revert(); });
|
||||
|
||||
$('a.cancel', row).click(function() { return inlineEditTax.revert(); });
|
||||
$('a.save', row).click(function() { return inlineEditTax.save(this); });
|
||||
$('input, select', row).keydown(function(e) { if(e.which == 13) return inlineEditTax.save(this); });
|
||||
|
||||
$('#posts-filter input[type="submit"]').mousedown(function(e){
|
||||
t.revert();
|
||||
});
|
||||
},
|
||||
|
||||
toggle : function(el) {
|
||||
var t = this;
|
||||
$(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el);
|
||||
},
|
||||
|
||||
edit : function(id) {
|
||||
var t = this, editRow;
|
||||
t.revert();
|
||||
|
||||
if ( typeof(id) == 'object' )
|
||||
id = t.getId(id);
|
||||
|
||||
editRow = $('#inline-edit').clone(true), rowData = $('#inline_'+id);
|
||||
$('td', editRow).attr('colspan', $('.widefat:first thead th:visible').length);
|
||||
|
||||
if ( $(t.what+id).hasClass('alternate') )
|
||||
$(editRow).addClass('alternate');
|
||||
|
||||
$(t.what+id).hide().after(editRow);
|
||||
|
||||
$(':input[name="name"]', editRow).val( $('.name', rowData).text() );
|
||||
$(':input[name="slug"]', editRow).val( $('.slug', rowData).text() );
|
||||
|
||||
$(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
|
||||
$('.ptitle', editRow).eq(0).focus();
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
save : function(id) {
|
||||
var params, fields, tax = $('input[name="taxonomy"]').val() || '';
|
||||
|
||||
if( typeof(id) == 'object' )
|
||||
id = this.getId(id);
|
||||
|
||||
$('table.widefat .inline-edit-save .waiting').show();
|
||||
|
||||
params = {
|
||||
action: 'inline-save-tax',
|
||||
tax_type: this.type,
|
||||
tax_ID: id,
|
||||
taxonomy: tax
|
||||
};
|
||||
|
||||
fields = $('#edit-'+id+' :input').serialize();
|
||||
params = fields + '&' + $.param(params);
|
||||
|
||||
// make ajax request
|
||||
$.post( ajaxurl, params,
|
||||
function(r) {
|
||||
var row, new_id;
|
||||
$('table.widefat .inline-edit-save .waiting').hide();
|
||||
|
||||
if (r) {
|
||||
if ( -1 != r.indexOf('<tr') ) {
|
||||
$(inlineEditTax.what+id).remove();
|
||||
new_id = $(r).attr('id');
|
||||
|
||||
$('#edit-'+id).before(r).remove();
|
||||
row = new_id ? $('#'+new_id) : $(inlineEditTax.what+id);
|
||||
row.hide().fadeIn();
|
||||
} else
|
||||
$('#edit-'+id+' .inline-edit-save .error').html(r).show();
|
||||
} else
|
||||
$('#edit-'+id+' .inline-edit-save .error').html(inlineEditL10n.error).show();
|
||||
}
|
||||
);
|
||||
return false;
|
||||
},
|
||||
|
||||
revert : function() {
|
||||
var id = $('table.widefat tr.inline-editor').attr('id');
|
||||
|
||||
if ( id ) {
|
||||
$('table.widefat .inline-edit-save .waiting').hide();
|
||||
$('#'+id).remove();
|
||||
id = id.substr( id.lastIndexOf('-') + 1 );
|
||||
$(this.what+id).show();
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
getId : function(o) {
|
||||
var id = o.tagName == 'TR' ? o.id : $(o).parents('tr').attr('id'), parts = id.split('-');
|
||||
return parts[parts.length - 1];
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function(){inlineEditTax.init();});
|
||||
})(jQuery);
|
|
@ -1 +1,118 @@
|
|||
(function(a){inlineEditTax={init:function(){var b=this,c=a("#inline-edit");b.type=a("#the-list").attr("class").substr(5);b.what="#"+b.type+"-";a(".editinline").live("click",function(){inlineEditTax.edit(this);return false});c.keyup(function(d){if(d.which==27){return inlineEditTax.revert()}});a("a.cancel",c).click(function(){return inlineEditTax.revert()});a("a.save",c).click(function(){return inlineEditTax.save(this)});a("input, select",c).keydown(function(d){if(d.which==13){return inlineEditTax.save(this)}});a('#posts-filter input[type="submit"]').mousedown(function(d){b.revert()})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},edit:function(d){var c=this,b;c.revert();if(typeof(d)=="object"){d=c.getId(d)}b=a("#inline-edit").clone(true),rowData=a("#inline_"+d);a("td",b).attr("colspan",a(".widefat:first thead th:visible").length);if(a(c.what+d).hasClass("alternate")){a(b).addClass("alternate")}a(c.what+d).hide().after(b);a(':input[name="name"]',b).val(a(".name",rowData).text());a(':input[name="slug"]',b).val(a(".slug",rowData).text());a(b).attr("id","edit-"+d).addClass("inline-editor").show();a(".ptitle",b).eq(0).focus();return false},save:function(e){var d,b,c=a('input[name="taxonomy"]').val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .inline-edit-save .waiting").show();d={action:"inline-save-tax",tax_type:this.type,tax_ID:e,taxonomy:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post(ajaxurl,d,function(g){var h,f;a("table.widefat .inline-edit-save .waiting").hide();if(g){if(-1!=g.indexOf("<tr")){a(inlineEditTax.what+e).remove();f=a(g).attr("id");a("#edit-"+e).before(g).remove();h=f?a("#"+f):a(inlineEditTax.what+e);h.hide().fadeIn()}else{a("#edit-"+e+" .inline-edit-save .error").html(g).show()}}else{a("#edit-"+e+" .inline-edit-save .error").html(inlineEditL10n.error).show()}});return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){a("table.widefat .inline-edit-save .waiting").hide();a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}return false},getId:function(c){var d=c.tagName=="TR"?c.id:a(c).parents("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditTax.init()})})(jQuery);
|
||||
|
||||
(function($) {
|
||||
inlineEditTax = {
|
||||
|
||||
init : function() {
|
||||
var t = this, row = $('#inline-edit');
|
||||
|
||||
t.type = $('#the-list').attr('class').substr(5);
|
||||
t.what = '#'+t.type+'-';
|
||||
|
||||
$('.editinline').live('click', function(){
|
||||
inlineEditTax.edit(this);
|
||||
return false;
|
||||
});
|
||||
|
||||
// prepare the edit row
|
||||
row.keyup(function(e) { if(e.which == 27) return inlineEditTax.revert(); });
|
||||
|
||||
$('a.cancel', row).click(function() { return inlineEditTax.revert(); });
|
||||
$('a.save', row).click(function() { return inlineEditTax.save(this); });
|
||||
$('input, select', row).keydown(function(e) { if(e.which == 13) return inlineEditTax.save(this); });
|
||||
|
||||
$('#posts-filter input[type="submit"]').mousedown(function(e){
|
||||
t.revert();
|
||||
});
|
||||
},
|
||||
|
||||
toggle : function(el) {
|
||||
var t = this;
|
||||
$(t.what+t.getId(el)).css('display') == 'none' ? t.revert() : t.edit(el);
|
||||
},
|
||||
|
||||
edit : function(id) {
|
||||
var t = this, editRow;
|
||||
t.revert();
|
||||
|
||||
if ( typeof(id) == 'object' )
|
||||
id = t.getId(id);
|
||||
|
||||
editRow = $('#inline-edit').clone(true), rowData = $('#inline_'+id);
|
||||
$('td', editRow).attr('colspan', $('.widefat:first thead th:visible').length);
|
||||
|
||||
if ( $(t.what+id).hasClass('alternate') )
|
||||
$(editRow).addClass('alternate');
|
||||
|
||||
$(t.what+id).hide().after(editRow);
|
||||
|
||||
$(':input[name="name"]', editRow).val( $('.name', rowData).text() );
|
||||
$(':input[name="slug"]', editRow).val( $('.slug', rowData).text() );
|
||||
|
||||
$(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
|
||||
$('.ptitle', editRow).eq(0).focus();
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
save : function(id) {
|
||||
var params, fields, tax = $('input[name="taxonomy"]').val() || '';
|
||||
|
||||
if( typeof(id) == 'object' )
|
||||
id = this.getId(id);
|
||||
|
||||
$('table.widefat .inline-edit-save .waiting').show();
|
||||
|
||||
params = {
|
||||
action: 'inline-save-tax',
|
||||
tax_type: this.type,
|
||||
tax_ID: id,
|
||||
taxonomy: tax
|
||||
};
|
||||
|
||||
fields = $('#edit-'+id+' :input').serialize();
|
||||
params = fields + '&' + $.param(params);
|
||||
|
||||
// make ajax request
|
||||
$.post( ajaxurl, params,
|
||||
function(r) {
|
||||
var row, new_id;
|
||||
$('table.widefat .inline-edit-save .waiting').hide();
|
||||
|
||||
if (r) {
|
||||
if ( -1 != r.indexOf('<tr') ) {
|
||||
$(inlineEditTax.what+id).remove();
|
||||
new_id = $(r).attr('id');
|
||||
|
||||
$('#edit-'+id).before(r).remove();
|
||||
row = new_id ? $('#'+new_id) : $(inlineEditTax.what+id);
|
||||
row.hide().fadeIn();
|
||||
} else
|
||||
$('#edit-'+id+' .inline-edit-save .error').html(r).show();
|
||||
} else
|
||||
$('#edit-'+id+' .inline-edit-save .error').html(inlineEditL10n.error).show();
|
||||
}
|
||||
);
|
||||
return false;
|
||||
},
|
||||
|
||||
revert : function() {
|
||||
var id = $('table.widefat tr.inline-editor').attr('id');
|
||||
|
||||
if ( id ) {
|
||||
$('table.widefat .inline-edit-save .waiting').hide();
|
||||
$('#'+id).remove();
|
||||
id = id.substr( id.lastIndexOf('-') + 1 );
|
||||
$(this.what+id).show();
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
getId : function(o) {
|
||||
var id = o.tagName == 'TR' ? o.id : $(o).parents('tr').attr('id'), parts = id.split('-');
|
||||
return parts[parts.length - 1];
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function(){inlineEditTax.init();});
|
||||
})(jQuery);
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
(function(a){inlineEditTax={init:function(){var b=this,c=a("#inline-edit");b.type=a("#the-list").attr("class").substr(5);b.what="#"+b.type+"-";a(".editinline").live("click",function(){inlineEditTax.edit(this);return false});c.keyup(function(d){if(d.which==27){return inlineEditTax.revert()}});a("a.cancel",c).click(function(){return inlineEditTax.revert()});a("a.save",c).click(function(){return inlineEditTax.save(this)});a("input, select",c).keydown(function(d){if(d.which==13){return inlineEditTax.save(this)}});a('#posts-filter input[type="submit"]').mousedown(function(d){b.revert()})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},edit:function(d){var c=this,b;c.revert();if(typeof(d)=="object"){d=c.getId(d)}b=a("#inline-edit").clone(true),rowData=a("#inline_"+d);a("td",b).attr("colspan",a(".widefat:first thead th:visible").length);if(a(c.what+d).hasClass("alternate")){a(b).addClass("alternate")}a(c.what+d).hide().after(b);a(':input[name="name"]',b).val(a(".name",rowData).text());a(':input[name="slug"]',b).val(a(".slug",rowData).text());a(b).attr("id","edit-"+d).addClass("inline-editor").show();a(".ptitle",b).eq(0).focus();return false},save:function(e){var d,b,c=a('input[name="taxonomy"]').val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .inline-edit-save .waiting").show();d={action:"inline-save-tax",tax_type:this.type,tax_ID:e,taxonomy:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post(ajaxurl,d,function(g){var h,f;a("table.widefat .inline-edit-save .waiting").hide();if(g){if(-1!=g.indexOf("<tr")){a(inlineEditTax.what+e).remove();f=a(g).attr("id");a("#edit-"+e).before(g).remove();h=f?a("#"+f):a(inlineEditTax.what+e);h.hide().fadeIn()}else{a("#edit-"+e+" .inline-edit-save .error").html(g).show()}}else{a("#edit-"+e+" .inline-edit-save .error").html(inlineEditL10n.error).show()}});return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){a("table.widefat .inline-edit-save .waiting").hide();a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}return false},getId:function(c){var d=c.tagName=="TR"?c.id:a(c).parents("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditTax.init()})})(jQuery);
|
|
@ -1,67 +0,0 @@
|
|||
jQuery(document).ready( function($) {
|
||||
|
||||
var newCat, noSyncChecks = false, syncChecks, catAddAfter;
|
||||
|
||||
$('#link_name').focus();
|
||||
// postboxes
|
||||
postboxes.add_postbox_toggles('link');
|
||||
|
||||
// category tabs
|
||||
$('#category-tabs a').click(function(){
|
||||
var t = $(this).attr('href');
|
||||
$(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
|
||||
$('.tabs-panel').hide();
|
||||
$(t).show();
|
||||
if ( '#categories-all' == t )
|
||||
deleteUserSetting('cats');
|
||||
else
|
||||
setUserSetting('cats','pop');
|
||||
return false;
|
||||
});
|
||||
if ( getUserSetting('cats') )
|
||||
$('#category-tabs a[href="#categories-pop"]').click();
|
||||
|
||||
// Ajax Cat
|
||||
newCat = $('#newcat').one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
|
||||
$('#category-add-submit').click( function() { newCat.focus(); } );
|
||||
syncChecks = function() {
|
||||
if ( noSyncChecks )
|
||||
return;
|
||||
noSyncChecks = true;
|
||||
var th = $(this), c = th.is(':checked'), id = th.val().toString();
|
||||
$('#in-link-category-' + id + ', #in-popular-category-' + id).prop( 'checked', c );
|
||||
noSyncChecks = false;
|
||||
};
|
||||
|
||||
catAddAfter = function( r, s ) {
|
||||
$(s.what + ' response_data', r).each( function() {
|
||||
var t = $($(this).text());
|
||||
t.find( 'label' ).each( function() {
|
||||
var th = $(this), val = th.find('input').val(), id = th.find('input')[0].id, name = $.trim( th.text() ), o;
|
||||
$('#' + id).change( syncChecks );
|
||||
o = $( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name );
|
||||
} );
|
||||
} );
|
||||
};
|
||||
|
||||
$('#categorychecklist').wpList( {
|
||||
alt: '',
|
||||
what: 'link-category',
|
||||
response: 'category-ajax-response',
|
||||
addAfter: catAddAfter
|
||||
} );
|
||||
|
||||
$('a[href="#categories-all"]').click(function(){deleteUserSetting('cats');});
|
||||
$('a[href="#categories-pop"]').click(function(){setUserSetting('cats','pop');});
|
||||
if ( 'pop' == getUserSetting('cats') )
|
||||
$('a[href="#categories-pop"]').click();
|
||||
|
||||
$('#category-add-toggle').click( function() {
|
||||
$(this).parents('div:first').toggleClass( 'wp-hidden-children' );
|
||||
$('#category-tabs a[href="#categories-all"]').click();
|
||||
$('#newcategory').focus();
|
||||
return false;
|
||||
} );
|
||||
|
||||
$('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
|
||||
});
|
|
@ -1 +1,67 @@
|
|||
jQuery(document).ready(function(c){var b,a=false,d,e;c("#link_name").focus();postboxes.add_postbox_toggles("link");c("#category-tabs a").click(function(){var f=c(this).attr("href");c(this).parent().addClass("tabs").siblings("li").removeClass("tabs");c(".tabs-panel").hide();c(f).show();if("#categories-all"==f){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){c('#category-tabs a[href="#categories-pop"]').click()}b=c("#newcat").one("focus",function(){c(this).val("").removeClass("form-input-tip")});c("#category-add-submit").click(function(){b.focus()});d=function(){if(a){return}a=true;var f=c(this),h=f.is(":checked"),g=f.val().toString();c("#in-link-category-"+g+", #in-popular-category-"+g).prop("checked",h);a=false};e=function(g,f){c(f.what+" response_data",g).each(function(){var h=c(c(this).text());h.find("label").each(function(){var j=c(this),l=j.find("input").val(),m=j.find("input")[0].id,i=c.trim(j.text()),k;c("#"+m).change(d);k=c('<option value="'+parseInt(l,10)+'"></option>').text(i)})})};c("#categorychecklist").wpList({alt:"",what:"link-category",response:"category-ajax-response",addAfter:e});c('a[href="#categories-all"]').click(function(){deleteUserSetting("cats")});c('a[href="#categories-pop"]').click(function(){setUserSetting("cats","pop")});if("pop"==getUserSetting("cats")){c('a[href="#categories-pop"]').click()}c("#category-add-toggle").click(function(){c(this).parents("div:first").toggleClass("wp-hidden-children");c('#category-tabs a[href="#categories-all"]').click();c("#newcategory").focus();return false});c(".categorychecklist :checkbox").change(d).filter(":checked").change()});
|
||||
jQuery(document).ready( function($) {
|
||||
|
||||
var newCat, noSyncChecks = false, syncChecks, catAddAfter;
|
||||
|
||||
$('#link_name').focus();
|
||||
// postboxes
|
||||
postboxes.add_postbox_toggles('link');
|
||||
|
||||
// category tabs
|
||||
$('#category-tabs a').click(function(){
|
||||
var t = $(this).attr('href');
|
||||
$(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
|
||||
$('.tabs-panel').hide();
|
||||
$(t).show();
|
||||
if ( '#categories-all' == t )
|
||||
deleteUserSetting('cats');
|
||||
else
|
||||
setUserSetting('cats','pop');
|
||||
return false;
|
||||
});
|
||||
if ( getUserSetting('cats') )
|
||||
$('#category-tabs a[href="#categories-pop"]').click();
|
||||
|
||||
// Ajax Cat
|
||||
newCat = $('#newcat').one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
|
||||
$('#category-add-submit').click( function() { newCat.focus(); } );
|
||||
syncChecks = function() {
|
||||
if ( noSyncChecks )
|
||||
return;
|
||||
noSyncChecks = true;
|
||||
var th = $(this), c = th.is(':checked'), id = th.val().toString();
|
||||
$('#in-link-category-' + id + ', #in-popular-category-' + id).prop( 'checked', c );
|
||||
noSyncChecks = false;
|
||||
};
|
||||
|
||||
catAddAfter = function( r, s ) {
|
||||
$(s.what + ' response_data', r).each( function() {
|
||||
var t = $($(this).text());
|
||||
t.find( 'label' ).each( function() {
|
||||
var th = $(this), val = th.find('input').val(), id = th.find('input')[0].id, name = $.trim( th.text() ), o;
|
||||
$('#' + id).change( syncChecks );
|
||||
o = $( '<option value="' + parseInt( val, 10 ) + '"></option>' ).text( name );
|
||||
} );
|
||||
} );
|
||||
};
|
||||
|
||||
$('#categorychecklist').wpList( {
|
||||
alt: '',
|
||||
what: 'link-category',
|
||||
response: 'category-ajax-response',
|
||||
addAfter: catAddAfter
|
||||
} );
|
||||
|
||||
$('a[href="#categories-all"]').click(function(){deleteUserSetting('cats');});
|
||||
$('a[href="#categories-pop"]').click(function(){setUserSetting('cats','pop');});
|
||||
if ( 'pop' == getUserSetting('cats') )
|
||||
$('a[href="#categories-pop"]').click();
|
||||
|
||||
$('#category-add-toggle').click( function() {
|
||||
$(this).parents('div:first').toggleClass( 'wp-hidden-children' );
|
||||
$('#category-tabs a[href="#categories-all"]').click();
|
||||
$('#newcategory').focus();
|
||||
return false;
|
||||
} );
|
||||
|
||||
$('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
|
||||
});
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
jQuery(document).ready(function(c){var b,a=false,d,e;c("#link_name").focus();postboxes.add_postbox_toggles("link");c("#category-tabs a").click(function(){var f=c(this).attr("href");c(this).parent().addClass("tabs").siblings("li").removeClass("tabs");c(".tabs-panel").hide();c(f).show();if("#categories-all"==f){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){c('#category-tabs a[href="#categories-pop"]').click()}b=c("#newcat").one("focus",function(){c(this).val("").removeClass("form-input-tip")});c("#category-add-submit").click(function(){b.focus()});d=function(){if(a){return}a=true;var f=c(this),h=f.is(":checked"),g=f.val().toString();c("#in-link-category-"+g+", #in-popular-category-"+g).prop("checked",h);a=false};e=function(g,f){c(f.what+" response_data",g).each(function(){var h=c(c(this).text());h.find("label").each(function(){var j=c(this),l=j.find("input").val(),m=j.find("input")[0].id,i=c.trim(j.text()),k;c("#"+m).change(d);k=c('<option value="'+parseInt(l,10)+'"></option>').text(i)})})};c("#categorychecklist").wpList({alt:"",what:"link-category",response:"category-ajax-response",addAfter:e});c('a[href="#categories-all"]').click(function(){deleteUserSetting("cats")});c('a[href="#categories-pop"]').click(function(){setUserSetting("cats","pop")});if("pop"==getUserSetting("cats")){c('a[href="#categories-pop"]').click()}c("#category-add-toggle").click(function(){c(this).parents("div:first").toggleClass("wp-hidden-children");c('#category-tabs a[href="#categories-all"]').click();c("#newcategory").focus();return false});c(".categorychecklist :checkbox").change(d).filter(":checked").change()});
|
|
@ -1,25 +0,0 @@
|
|||
jQuery(function($){
|
||||
$( 'body' ).bind( 'click.wp-gallery', function(e){
|
||||
var target = $( e.target ), id, img_size;
|
||||
|
||||
if ( target.hasClass( 'wp-set-header' ) ) {
|
||||
( window.dialogArguments || opener || parent || top ).location.href = target.data( 'location' );
|
||||
e.preventDefault();
|
||||
} else if ( target.hasClass( 'wp-set-background' ) ) {
|
||||
id = target.data( 'attachment-id' );
|
||||
img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val();
|
||||
|
||||
jQuery.post(ajaxurl, {
|
||||
action: 'set-background-image',
|
||||
attachment_id: id,
|
||||
size: img_size
|
||||
}, function(){
|
||||
var win = window.dialogArguments || opener || parent || top;
|
||||
win.tb_remove();
|
||||
win.location.reload();
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
|
@ -1 +1,25 @@
|
|||
jQuery(function(a){a("body").bind("click.wp-gallery",function(d){var c=a(d.target),f,b;if(c.hasClass("wp-set-header")){(window.dialogArguments||opener||parent||top).location.href=c.data("location");d.preventDefault()}else{if(c.hasClass("wp-set-background")){f=c.data("attachment-id");b=a('input[name="attachments['+f+'][image-size]"]:checked').val();jQuery.post(ajaxurl,{action:"set-background-image",attachment_id:f,size:b},function(){var e=window.dialogArguments||opener||parent||top;e.tb_remove();e.location.reload()});d.preventDefault()}}})});
|
||||
jQuery(function($){
|
||||
$( 'body' ).bind( 'click.wp-gallery', function(e){
|
||||
var target = $( e.target ), id, img_size;
|
||||
|
||||
if ( target.hasClass( 'wp-set-header' ) ) {
|
||||
( window.dialogArguments || opener || parent || top ).location.href = target.data( 'location' );
|
||||
e.preventDefault();
|
||||
} else if ( target.hasClass( 'wp-set-background' ) ) {
|
||||
id = target.data( 'attachment-id' );
|
||||
img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val();
|
||||
|
||||
jQuery.post(ajaxurl, {
|
||||
action: 'set-background-image',
|
||||
attachment_id: id,
|
||||
size: img_size
|
||||
}, function(){
|
||||
var win = window.dialogArguments || opener || parent || top;
|
||||
win.tb_remove();
|
||||
win.location.reload();
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
jQuery(function(a){a("body").bind("click.wp-gallery",function(d){var c=a(d.target),f,b;if(c.hasClass("wp-set-header")){(window.dialogArguments||opener||parent||top).location.href=c.data("location");d.preventDefault()}else{if(c.hasClass("wp-set-background")){f=c.data("attachment-id");b=a('input[name="attachments['+f+'][image-size]"]:checked').val();jQuery.post(ajaxurl,{action:"set-background-image",attachment_id:f,size:b},function(){var e=window.dialogArguments||opener||parent||top;e.tb_remove();e.location.reload()});d.preventDefault()}}})});
|
|
@ -1,88 +0,0 @@
|
|||
// send html to the post editor
|
||||
|
||||
var wpActiveEditor;
|
||||
|
||||
function send_to_editor(h) {
|
||||
var ed, mce = typeof(tinymce) != 'undefined', qt = typeof(QTags) != 'undefined';
|
||||
|
||||
if ( !wpActiveEditor ) {
|
||||
if ( mce && tinymce.activeEditor ) {
|
||||
ed = tinymce.activeEditor;
|
||||
wpActiveEditor = ed.id;
|
||||
} else if ( !qt ) {
|
||||
return false;
|
||||
}
|
||||
} else if ( mce ) {
|
||||
if ( tinymce.activeEditor && (tinymce.activeEditor.id == 'mce_fullscreen' || tinymce.activeEditor.id == 'wp_mce_fullscreen') )
|
||||
ed = tinymce.activeEditor;
|
||||
else
|
||||
ed = tinymce.get(wpActiveEditor);
|
||||
}
|
||||
|
||||
if ( ed && !ed.isHidden() ) {
|
||||
// restore caret position on IE
|
||||
if ( tinymce.isIE && ed.windowManager.insertimagebookmark )
|
||||
ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
|
||||
|
||||
if ( h.indexOf('[caption') === 0 ) {
|
||||
if ( ed.wpSetImgCaption )
|
||||
h = ed.wpSetImgCaption(h);
|
||||
} else if ( h.indexOf('[gallery') === 0 ) {
|
||||
if ( ed.plugins.wpgallery )
|
||||
h = ed.plugins.wpgallery._do_gallery(h);
|
||||
} else if ( h.indexOf('[embed') === 0 ) {
|
||||
if ( ed.plugins.wordpress )
|
||||
h = ed.plugins.wordpress._setEmbed(h);
|
||||
}
|
||||
|
||||
ed.execCommand('mceInsertContent', false, h);
|
||||
} else if ( qt ) {
|
||||
QTags.insertContent(h);
|
||||
} else {
|
||||
document.getElementById(wpActiveEditor).value += h;
|
||||
}
|
||||
|
||||
try{tb_remove();}catch(e){};
|
||||
}
|
||||
|
||||
// thickbox settings
|
||||
var tb_position;
|
||||
(function($) {
|
||||
tb_position = function() {
|
||||
var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width, adminbar_height = 0;
|
||||
|
||||
if ( $('body.admin-bar').length )
|
||||
adminbar_height = 28;
|
||||
|
||||
if ( tbWindow.size() ) {
|
||||
tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
|
||||
$('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
|
||||
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
|
||||
if ( typeof document.body.style.maxWidth != 'undefined' )
|
||||
tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
|
||||
};
|
||||
|
||||
return $('a.thickbox').each( function() {
|
||||
var href = $(this).attr('href');
|
||||
if ( ! href ) return;
|
||||
href = href.replace(/&width=[0-9]+/g, '');
|
||||
href = href.replace(/&height=[0-9]+/g, '');
|
||||
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 - adminbar_height ) );
|
||||
});
|
||||
};
|
||||
|
||||
$(window).resize(function(){ tb_position(); });
|
||||
|
||||
// store caret position in IE
|
||||
$(document).ready(function($){
|
||||
$('a.thickbox').click(function(){
|
||||
var ed;
|
||||
|
||||
if ( typeof(tinymce) != 'undefined' && tinymce.isIE && ( ed = tinymce.get(wpActiveEditor) ) && !ed.isHidden() ) {
|
||||
ed.focus();
|
||||
ed.windowManager.insertimagebookmark = ed.selection.getBookmark();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery);
|
|
@ -1 +1,88 @@
|
|||
var wpActiveEditor;function send_to_editor(c){var b,a=typeof(tinymce)!="undefined",f=typeof(QTags)!="undefined";if(!wpActiveEditor){if(a&&tinymce.activeEditor){b=tinymce.activeEditor;wpActiveEditor=b.id}else{if(!f){return false}}}else{if(a){if(tinymce.activeEditor&&(tinymce.activeEditor.id=="mce_fullscreen"||tinymce.activeEditor.id=="wp_mce_fullscreen")){b=tinymce.activeEditor}else{b=tinymce.get(wpActiveEditor)}}}if(b&&!b.isHidden()){if(tinymce.isIE&&b.windowManager.insertimagebookmark){b.selection.moveToBookmark(b.windowManager.insertimagebookmark)}if(c.indexOf("[caption")===0){if(b.wpSetImgCaption){c=b.wpSetImgCaption(c)}}else{if(c.indexOf("[gallery")===0){if(b.plugins.wpgallery){c=b.plugins.wpgallery._do_gallery(c)}}else{if(c.indexOf("[embed")===0){if(b.plugins.wordpress){c=b.plugins.wordpress._setEmbed(c)}}}}b.execCommand("mceInsertContent",false,c)}else{if(f){QTags.insertContent(c)}else{document.getElementById(wpActiveEditor).value+=c}}try{tb_remove()}catch(d){}}var tb_position;(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()});a(document).ready(function(b){b("a.thickbox").click(function(){var c;if(typeof(tinymce)!="undefined"&&tinymce.isIE&&(c=tinymce.get(wpActiveEditor))&&!c.isHidden()){c.focus();c.windowManager.insertimagebookmark=c.selection.getBookmark()}})})})(jQuery);
|
||||
// send html to the post editor
|
||||
|
||||
var wpActiveEditor;
|
||||
|
||||
function send_to_editor(h) {
|
||||
var ed, mce = typeof(tinymce) != 'undefined', qt = typeof(QTags) != 'undefined';
|
||||
|
||||
if ( !wpActiveEditor ) {
|
||||
if ( mce && tinymce.activeEditor ) {
|
||||
ed = tinymce.activeEditor;
|
||||
wpActiveEditor = ed.id;
|
||||
} else if ( !qt ) {
|
||||
return false;
|
||||
}
|
||||
} else if ( mce ) {
|
||||
if ( tinymce.activeEditor && (tinymce.activeEditor.id == 'mce_fullscreen' || tinymce.activeEditor.id == 'wp_mce_fullscreen') )
|
||||
ed = tinymce.activeEditor;
|
||||
else
|
||||
ed = tinymce.get(wpActiveEditor);
|
||||
}
|
||||
|
||||
if ( ed && !ed.isHidden() ) {
|
||||
// restore caret position on IE
|
||||
if ( tinymce.isIE && ed.windowManager.insertimagebookmark )
|
||||
ed.selection.moveToBookmark(ed.windowManager.insertimagebookmark);
|
||||
|
||||
if ( h.indexOf('[caption') === 0 ) {
|
||||
if ( ed.wpSetImgCaption )
|
||||
h = ed.wpSetImgCaption(h);
|
||||
} else if ( h.indexOf('[gallery') === 0 ) {
|
||||
if ( ed.plugins.wpgallery )
|
||||
h = ed.plugins.wpgallery._do_gallery(h);
|
||||
} else if ( h.indexOf('[embed') === 0 ) {
|
||||
if ( ed.plugins.wordpress )
|
||||
h = ed.plugins.wordpress._setEmbed(h);
|
||||
}
|
||||
|
||||
ed.execCommand('mceInsertContent', false, h);
|
||||
} else if ( qt ) {
|
||||
QTags.insertContent(h);
|
||||
} else {
|
||||
document.getElementById(wpActiveEditor).value += h;
|
||||
}
|
||||
|
||||
try{tb_remove();}catch(e){};
|
||||
}
|
||||
|
||||
// thickbox settings
|
||||
var tb_position;
|
||||
(function($) {
|
||||
tb_position = function() {
|
||||
var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width, adminbar_height = 0;
|
||||
|
||||
if ( $('body.admin-bar').length )
|
||||
adminbar_height = 28;
|
||||
|
||||
if ( tbWindow.size() ) {
|
||||
tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
|
||||
$('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
|
||||
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
|
||||
if ( typeof document.body.style.maxWidth != 'undefined' )
|
||||
tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
|
||||
};
|
||||
|
||||
return $('a.thickbox').each( function() {
|
||||
var href = $(this).attr('href');
|
||||
if ( ! href ) return;
|
||||
href = href.replace(/&width=[0-9]+/g, '');
|
||||
href = href.replace(/&height=[0-9]+/g, '');
|
||||
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 - adminbar_height ) );
|
||||
});
|
||||
};
|
||||
|
||||
$(window).resize(function(){ tb_position(); });
|
||||
|
||||
// store caret position in IE
|
||||
$(document).ready(function($){
|
||||
$('a.thickbox').click(function(){
|
||||
var ed;
|
||||
|
||||
if ( typeof(tinymce) != 'undefined' && tinymce.isIE && ( ed = tinymce.get(wpActiveEditor) ) && !ed.isHidden() ) {
|
||||
ed.focus();
|
||||
ed.windowManager.insertimagebookmark = ed.selection.getBookmark();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
var wpActiveEditor;function send_to_editor(c){var b,a=typeof(tinymce)!="undefined",f=typeof(QTags)!="undefined";if(!wpActiveEditor){if(a&&tinymce.activeEditor){b=tinymce.activeEditor;wpActiveEditor=b.id}else{if(!f){return false}}}else{if(a){if(tinymce.activeEditor&&(tinymce.activeEditor.id=="mce_fullscreen"||tinymce.activeEditor.id=="wp_mce_fullscreen")){b=tinymce.activeEditor}else{b=tinymce.get(wpActiveEditor)}}}if(b&&!b.isHidden()){if(tinymce.isIE&&b.windowManager.insertimagebookmark){b.selection.moveToBookmark(b.windowManager.insertimagebookmark)}if(c.indexOf("[caption")===0){if(b.wpSetImgCaption){c=b.wpSetImgCaption(c)}}else{if(c.indexOf("[gallery")===0){if(b.plugins.wpgallery){c=b.plugins.wpgallery._do_gallery(c)}}else{if(c.indexOf("[embed")===0){if(b.plugins.wordpress){c=b.plugins.wordpress._setEmbed(c)}}}}b.execCommand("mceInsertContent",false,c)}else{if(f){QTags.insertContent(c)}else{document.getElementById(wpActiveEditor).value+=c}}try{tb_remove()}catch(d){}}var tb_position;(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()});a(document).ready(function(b){b("a.thickbox").click(function(){var c;if(typeof(tinymce)!="undefined"&&tinymce.isIE&&(c=tinymce.get(wpActiveEditor))&&!c.isHidden()){c.focus();c.windowManager.insertimagebookmark=c.selection.getBookmark()}})})})(jQuery);
|
|
@ -1,94 +0,0 @@
|
|||
|
||||
var findPosts;
|
||||
(function($){
|
||||
findPosts = {
|
||||
open : function(af_name, af_val) {
|
||||
var st = document.documentElement.scrollTop || $(document).scrollTop();
|
||||
|
||||
if ( af_name && af_val ) {
|
||||
$('#affected').attr('name', af_name).val(af_val);
|
||||
}
|
||||
$('#find-posts').show().draggable({
|
||||
handle: '#find-posts-head'
|
||||
}).css({'top':st + 50 + 'px','left':'50%','marginLeft':'-250px'});
|
||||
|
||||
$('#find-posts-input').focus().keyup(function(e){
|
||||
if (e.which == 27) { findPosts.close(); } // close on Escape
|
||||
});
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
close : function() {
|
||||
$('#find-posts-response').html('');
|
||||
$('#find-posts').draggable('destroy').hide();
|
||||
},
|
||||
|
||||
send : function() {
|
||||
var post = {
|
||||
ps: $('#find-posts-input').val(),
|
||||
action: 'find_posts',
|
||||
_ajax_nonce: $('#_ajax_nonce').val(),
|
||||
post_type: $('input[name="find-posts-what"]:checked').val()
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : ajaxurl,
|
||||
data : post,
|
||||
success : function(x) { findPosts.show(x); },
|
||||
error : function(r) { findPosts.error(r); }
|
||||
});
|
||||
},
|
||||
|
||||
show : function(x) {
|
||||
|
||||
if ( typeof(x) == 'string' ) {
|
||||
this.error({'responseText': x});
|
||||
return;
|
||||
}
|
||||
|
||||
var r = wpAjax.parseAjaxResponse(x);
|
||||
|
||||
if ( r.errors ) {
|
||||
this.error({'responseText': wpAjax.broken});
|
||||
}
|
||||
r = r.responses[0];
|
||||
$('#find-posts-response').html(r.data);
|
||||
},
|
||||
|
||||
error : function(r) {
|
||||
var er = r.statusText;
|
||||
|
||||
if ( r.responseText ) {
|
||||
er = r.responseText.replace( /<.[^<>]*?>/g, '' );
|
||||
}
|
||||
if ( er ) {
|
||||
$('#find-posts-response').html(er);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#find-posts-submit').click(function(e) {
|
||||
if ( '' == $('#find-posts-response').html() )
|
||||
e.preventDefault();
|
||||
});
|
||||
$( '#find-posts .find-box-search :input' ).keypress( function( event ) {
|
||||
if ( 13 == event.which ) {
|
||||
findPosts.send();
|
||||
return false;
|
||||
}
|
||||
} );
|
||||
$( '#find-posts-search' ).click( findPosts.send );
|
||||
$( '#find-posts-close' ).click( findPosts.close );
|
||||
$('#doaction, #doaction2').click(function(e){
|
||||
$('select[name^="action"]').each(function(){
|
||||
if ( $(this).val() == 'attach' ) {
|
||||
e.preventDefault();
|
||||
findPosts.open();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
|
@ -1 +1,94 @@
|
|||
var findPosts;(function(a){findPosts={open:function(d,c){var b=document.documentElement.scrollTop||a(document).scrollTop();if(d&&c){a("#affected").attr("name",d).val(c)}a("#find-posts").show().draggable({handle:"#find-posts-head"}).css({top:b+50+"px",left:"50%",marginLeft:"-250px"});a("#find-posts-input").focus().keyup(function(f){if(f.which==27){findPosts.close()}});return false},close:function(){a("#find-posts-response").html("");a("#find-posts").draggable("destroy").hide()},send:function(){var b={ps:a("#find-posts-input").val(),action:"find_posts",_ajax_nonce:a("#_ajax_nonce").val(),post_type:a('input[name="find-posts-what"]:checked').val()};a.ajax({type:"POST",url:ajaxurl,data:b,success:function(c){findPosts.show(c)},error:function(c){findPosts.error(c)}})},show:function(b){if(typeof(b)=="string"){this.error({responseText:b});return}var c=wpAjax.parseAjaxResponse(b);if(c.errors){this.error({responseText:wpAjax.broken})}c=c.responses[0];a("#find-posts-response").html(c.data)},error:function(b){var c=b.statusText;if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#find-posts-response").html(c)}}};a(document).ready(function(){a("#find-posts-submit").click(function(b){if(""==a("#find-posts-response").html()){b.preventDefault()}});a("#find-posts .find-box-search :input").keypress(function(b){if(13==b.which){findPosts.send();return false}});a("#find-posts-search").click(findPosts.send);a("#find-posts-close").click(findPosts.close);a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){if(a(this).val()=="attach"){b.preventDefault();findPosts.open()}})})})})(jQuery);
|
||||
|
||||
var findPosts;
|
||||
(function($){
|
||||
findPosts = {
|
||||
open : function(af_name, af_val) {
|
||||
var st = document.documentElement.scrollTop || $(document).scrollTop();
|
||||
|
||||
if ( af_name && af_val ) {
|
||||
$('#affected').attr('name', af_name).val(af_val);
|
||||
}
|
||||
$('#find-posts').show().draggable({
|
||||
handle: '#find-posts-head'
|
||||
}).css({'top':st + 50 + 'px','left':'50%','marginLeft':'-250px'});
|
||||
|
||||
$('#find-posts-input').focus().keyup(function(e){
|
||||
if (e.which == 27) { findPosts.close(); } // close on Escape
|
||||
});
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
close : function() {
|
||||
$('#find-posts-response').html('');
|
||||
$('#find-posts').draggable('destroy').hide();
|
||||
},
|
||||
|
||||
send : function() {
|
||||
var post = {
|
||||
ps: $('#find-posts-input').val(),
|
||||
action: 'find_posts',
|
||||
_ajax_nonce: $('#_ajax_nonce').val(),
|
||||
post_type: $('input[name="find-posts-what"]:checked').val()
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : ajaxurl,
|
||||
data : post,
|
||||
success : function(x) { findPosts.show(x); },
|
||||
error : function(r) { findPosts.error(r); }
|
||||
});
|
||||
},
|
||||
|
||||
show : function(x) {
|
||||
|
||||
if ( typeof(x) == 'string' ) {
|
||||
this.error({'responseText': x});
|
||||
return;
|
||||
}
|
||||
|
||||
var r = wpAjax.parseAjaxResponse(x);
|
||||
|
||||
if ( r.errors ) {
|
||||
this.error({'responseText': wpAjax.broken});
|
||||
}
|
||||
r = r.responses[0];
|
||||
$('#find-posts-response').html(r.data);
|
||||
},
|
||||
|
||||
error : function(r) {
|
||||
var er = r.statusText;
|
||||
|
||||
if ( r.responseText ) {
|
||||
er = r.responseText.replace( /<.[^<>]*?>/g, '' );
|
||||
}
|
||||
if ( er ) {
|
||||
$('#find-posts-response').html(er);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#find-posts-submit').click(function(e) {
|
||||
if ( '' == $('#find-posts-response').html() )
|
||||
e.preventDefault();
|
||||
});
|
||||
$( '#find-posts .find-box-search :input' ).keypress( function( event ) {
|
||||
if ( 13 == event.which ) {
|
||||
findPosts.send();
|
||||
return false;
|
||||
}
|
||||
} );
|
||||
$( '#find-posts-search' ).click( findPosts.send );
|
||||
$( '#find-posts-close' ).click( findPosts.close );
|
||||
$('#doaction, #doaction2').click(function(e){
|
||||
$('select[name^="action"]').each(function(){
|
||||
if ( $(this).val() == 'attach' ) {
|
||||
e.preventDefault();
|
||||
findPosts.open();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
var findPosts;(function(a){findPosts={open:function(d,c){var b=document.documentElement.scrollTop||a(document).scrollTop();if(d&&c){a("#affected").attr("name",d).val(c)}a("#find-posts").show().draggable({handle:"#find-posts-head"}).css({top:b+50+"px",left:"50%",marginLeft:"-250px"});a("#find-posts-input").focus().keyup(function(f){if(f.which==27){findPosts.close()}});return false},close:function(){a("#find-posts-response").html("");a("#find-posts").draggable("destroy").hide()},send:function(){var b={ps:a("#find-posts-input").val(),action:"find_posts",_ajax_nonce:a("#_ajax_nonce").val(),post_type:a('input[name="find-posts-what"]:checked').val()};a.ajax({type:"POST",url:ajaxurl,data:b,success:function(c){findPosts.show(c)},error:function(c){findPosts.error(c)}})},show:function(b){if(typeof(b)=="string"){this.error({responseText:b});return}var c=wpAjax.parseAjaxResponse(b);if(c.errors){this.error({responseText:wpAjax.broken})}c=c.responses[0];a("#find-posts-response").html(c.data)},error:function(b){var c=b.statusText;if(b.responseText){c=b.responseText.replace(/<.[^<>]*?>/g,"")}if(c){a("#find-posts-response").html(c)}}};a(document).ready(function(){a("#find-posts-submit").click(function(b){if(""==a("#find-posts-response").html()){b.preventDefault()}});a("#find-posts .find-box-search :input").keypress(function(b){if(13==b.which){findPosts.send();return false}});a("#find-posts-search").click(findPosts.send);a("#find-posts-close").click(findPosts.close);a("#doaction, #doaction2").click(function(b){a('select[name^="action"]').each(function(){if(a(this).val()=="attach"){b.preventDefault();findPosts.open()}})})})})(jQuery);
|
|
@ -1,965 +0,0 @@
|
|||
/**
|
||||
* WordPress Administration Navigation Menu
|
||||
* Interface JS functions
|
||||
*
|
||||
* @version 2.0.0
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
var wpNavMenu;
|
||||
|
||||
(function($) {
|
||||
|
||||
var api = wpNavMenu = {
|
||||
|
||||
options : {
|
||||
menuItemDepthPerLevel : 30, // Do not use directly. Use depthToPx and pxToDepth instead.
|
||||
globalMaxDepth : 11
|
||||
},
|
||||
|
||||
menuList : undefined, // Set in init.
|
||||
targetList : undefined, // Set in init.
|
||||
menusChanged : false,
|
||||
isRTL: !! ( 'undefined' != typeof isRtl && isRtl ),
|
||||
negateIfRTL: ( 'undefined' != typeof isRtl && isRtl ) ? -1 : 1,
|
||||
|
||||
// Functions that run on init.
|
||||
init : function() {
|
||||
api.menuList = $('#menu-to-edit');
|
||||
api.targetList = api.menuList;
|
||||
|
||||
this.jQueryExtensions();
|
||||
|
||||
this.attachMenuEditListeners();
|
||||
|
||||
this.setupInputWithDefaultTitle();
|
||||
this.attachQuickSearchListeners();
|
||||
this.attachThemeLocationsListeners();
|
||||
|
||||
this.attachTabsPanelListeners();
|
||||
|
||||
this.attachUnsavedChangesListener();
|
||||
|
||||
if( api.menuList.length ) // If no menu, we're in the + tab.
|
||||
this.initSortables();
|
||||
|
||||
this.initToggles();
|
||||
|
||||
this.initTabManager();
|
||||
},
|
||||
|
||||
jQueryExtensions : function() {
|
||||
// jQuery extensions
|
||||
$.fn.extend({
|
||||
menuItemDepth : function() {
|
||||
var margin = api.isRTL ? this.eq(0).css('margin-right') : this.eq(0).css('margin-left');
|
||||
return api.pxToDepth( margin && -1 != margin.indexOf('px') ? margin.slice(0, -2) : 0 );
|
||||
},
|
||||
updateDepthClass : function(current, prev) {
|
||||
return this.each(function(){
|
||||
var t = $(this);
|
||||
prev = prev || t.menuItemDepth();
|
||||
$(this).removeClass('menu-item-depth-'+ prev )
|
||||
.addClass('menu-item-depth-'+ current );
|
||||
});
|
||||
},
|
||||
shiftDepthClass : function(change) {
|
||||
return this.each(function(){
|
||||
var t = $(this),
|
||||
depth = t.menuItemDepth();
|
||||
$(this).removeClass('menu-item-depth-'+ depth )
|
||||
.addClass('menu-item-depth-'+ (depth + change) );
|
||||
});
|
||||
},
|
||||
childMenuItems : function() {
|
||||
var result = $();
|
||||
this.each(function(){
|
||||
var t = $(this), depth = t.menuItemDepth(), next = t.next();
|
||||
while( next.length && next.menuItemDepth() > depth ) {
|
||||
result = result.add( next );
|
||||
next = next.next();
|
||||
}
|
||||
});
|
||||
return result;
|
||||
},
|
||||
updateParentMenuItemDBId : function() {
|
||||
return this.each(function(){
|
||||
var item = $(this),
|
||||
input = item.find('.menu-item-data-parent-id'),
|
||||
depth = item.menuItemDepth(),
|
||||
parent = item.prev();
|
||||
|
||||
if( depth == 0 ) { // Item is on the top level, has no parent
|
||||
input.val(0);
|
||||
} else { // Find the parent item, and retrieve its object id.
|
||||
while( ! parent[0] || ! parent[0].className || -1 == parent[0].className.indexOf('menu-item') || ( parent.menuItemDepth() != depth - 1 ) )
|
||||
parent = parent.prev();
|
||||
input.val( parent.find('.menu-item-data-db-id').val() );
|
||||
}
|
||||
});
|
||||
},
|
||||
hideAdvancedMenuItemFields : function() {
|
||||
return this.each(function(){
|
||||
var that = $(this);
|
||||
$('.hide-column-tog').not(':checked').each(function(){
|
||||
that.find('.field-' + $(this).val() ).addClass('hidden-field');
|
||||
});
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Adds selected menu items to the menu.
|
||||
*
|
||||
* @param jQuery metabox The metabox jQuery object.
|
||||
*/
|
||||
addSelectedToMenu : function(processMethod) {
|
||||
if ( 0 == $('#menu-to-edit').length ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.each(function() {
|
||||
var t = $(this), menuItems = {},
|
||||
checkboxes = t.find('.tabs-panel-active .categorychecklist li input:checked'),
|
||||
re = new RegExp('menu-item\\[(\[^\\]\]*)');
|
||||
|
||||
processMethod = processMethod || api.addMenuItemToBottom;
|
||||
|
||||
// If no items are checked, bail.
|
||||
if ( !checkboxes.length )
|
||||
return false;
|
||||
|
||||
// Show the ajax spinner
|
||||
t.find('img.waiting').show();
|
||||
|
||||
// Retrieve menu item data
|
||||
$(checkboxes).each(function(){
|
||||
var t = $(this),
|
||||
listItemDBIDMatch = re.exec( t.attr('name') ),
|
||||
listItemDBID = 'undefined' == typeof listItemDBIDMatch[1] ? 0 : parseInt(listItemDBIDMatch[1], 10);
|
||||
if ( this.className && -1 != this.className.indexOf('add-to-top') )
|
||||
processMethod = api.addMenuItemToTop;
|
||||
menuItems[listItemDBID] = t.closest('li').getItemData( 'add-menu-item', listItemDBID );
|
||||
});
|
||||
|
||||
// Add the items
|
||||
api.addItemToMenu(menuItems, processMethod, function(){
|
||||
// Deselect the items and hide the ajax spinner
|
||||
checkboxes.removeAttr('checked');
|
||||
t.find('img.waiting').hide();
|
||||
});
|
||||
});
|
||||
},
|
||||
getItemData : function( itemType, id ) {
|
||||
itemType = itemType || 'menu-item';
|
||||
|
||||
var itemData = {}, i,
|
||||
fields = [
|
||||
'menu-item-db-id',
|
||||
'menu-item-object-id',
|
||||
'menu-item-object',
|
||||
'menu-item-parent-id',
|
||||
'menu-item-position',
|
||||
'menu-item-type',
|
||||
'menu-item-title',
|
||||
'menu-item-url',
|
||||
'menu-item-description',
|
||||
'menu-item-attr-title',
|
||||
'menu-item-target',
|
||||
'menu-item-classes',
|
||||
'menu-item-xfn'
|
||||
];
|
||||
|
||||
if( !id && itemType == 'menu-item' ) {
|
||||
id = this.find('.menu-item-data-db-id').val();
|
||||
}
|
||||
|
||||
if( !id ) return itemData;
|
||||
|
||||
this.find('input').each(function() {
|
||||
var field;
|
||||
i = fields.length;
|
||||
while ( i-- ) {
|
||||
if( itemType == 'menu-item' )
|
||||
field = fields[i] + '[' + id + ']';
|
||||
else if( itemType == 'add-menu-item' )
|
||||
field = 'menu-item[' + id + '][' + fields[i] + ']';
|
||||
|
||||
if (
|
||||
this.name &&
|
||||
field == this.name
|
||||
) {
|
||||
itemData[fields[i]] = this.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return itemData;
|
||||
},
|
||||
setItemData : function( itemData, itemType, id ) { // Can take a type, such as 'menu-item', or an id.
|
||||
itemType = itemType || 'menu-item';
|
||||
|
||||
if( !id && itemType == 'menu-item' ) {
|
||||
id = $('.menu-item-data-db-id', this).val();
|
||||
}
|
||||
|
||||
if( !id ) return this;
|
||||
|
||||
this.find('input').each(function() {
|
||||
var t = $(this), field;
|
||||
$.each( itemData, function( attr, val ) {
|
||||
if( itemType == 'menu-item' )
|
||||
field = attr + '[' + id + ']';
|
||||
else if( itemType == 'add-menu-item' )
|
||||
field = 'menu-item[' + id + '][' + attr + ']';
|
||||
|
||||
if ( field == t.attr('name') ) {
|
||||
t.val( val );
|
||||
}
|
||||
});
|
||||
});
|
||||
return this;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
initToggles : function() {
|
||||
// init postboxes
|
||||
postboxes.add_postbox_toggles('nav-menus');
|
||||
|
||||
// adjust columns functions for menus UI
|
||||
columns.useCheckboxesForHidden();
|
||||
columns.checked = function(field) {
|
||||
$('.field-' + field).removeClass('hidden-field');
|
||||
}
|
||||
columns.unchecked = function(field) {
|
||||
$('.field-' + field).addClass('hidden-field');
|
||||
}
|
||||
// hide fields
|
||||
api.menuList.hideAdvancedMenuItemFields();
|
||||
},
|
||||
|
||||
initSortables : function() {
|
||||
var currentDepth = 0, originalDepth, minDepth, maxDepth,
|
||||
prev, next, prevBottom, nextThreshold, helperHeight, transport,
|
||||
menuEdge = api.menuList.offset().left,
|
||||
body = $('body'), maxChildDepth,
|
||||
menuMaxDepth = initialMenuMaxDepth();
|
||||
|
||||
// Use the right edge if RTL.
|
||||
menuEdge += api.isRTL ? api.menuList.width() : 0;
|
||||
|
||||
api.menuList.sortable({
|
||||
handle: '.menu-item-handle',
|
||||
placeholder: 'sortable-placeholder',
|
||||
start: function(e, ui) {
|
||||
var height, width, parent, children, tempHolder;
|
||||
|
||||
// handle placement for rtl orientation
|
||||
if ( api.isRTL )
|
||||
ui.item[0].style.right = 'auto';
|
||||
|
||||
transport = ui.item.children('.menu-item-transport');
|
||||
|
||||
// Set depths. currentDepth must be set before children are located.
|
||||
originalDepth = ui.item.menuItemDepth();
|
||||
updateCurrentDepth(ui, originalDepth);
|
||||
|
||||
// Attach child elements to parent
|
||||
// Skip the placeholder
|
||||
parent = ( ui.item.next()[0] == ui.placeholder[0] ) ? ui.item.next() : ui.item;
|
||||
children = parent.childMenuItems();
|
||||
transport.append( children );
|
||||
|
||||
// Update the height of the placeholder to match the moving item.
|
||||
height = transport.outerHeight();
|
||||
// If there are children, account for distance between top of children and parent
|
||||
height += ( height > 0 ) ? (ui.placeholder.css('margin-top').slice(0, -2) * 1) : 0;
|
||||
height += ui.helper.outerHeight();
|
||||
helperHeight = height;
|
||||
height -= 2; // Subtract 2 for borders
|
||||
ui.placeholder.height(height);
|
||||
|
||||
// Update the width of the placeholder to match the moving item.
|
||||
maxChildDepth = originalDepth;
|
||||
children.each(function(){
|
||||
var depth = $(this).menuItemDepth();
|
||||
maxChildDepth = (depth > maxChildDepth) ? depth : maxChildDepth;
|
||||
});
|
||||
width = ui.helper.find('.menu-item-handle').outerWidth(); // Get original width
|
||||
width += api.depthToPx(maxChildDepth - originalDepth); // Account for children
|
||||
width -= 2; // Subtract 2 for borders
|
||||
ui.placeholder.width(width);
|
||||
|
||||
// Update the list of menu items.
|
||||
tempHolder = ui.placeholder.next();
|
||||
tempHolder.css( 'margin-top', helperHeight + 'px' ); // Set the margin to absorb the placeholder
|
||||
ui.placeholder.detach(); // detach or jQuery UI will think the placeholder is a menu item
|
||||
$(this).sortable( "refresh" ); // The children aren't sortable. We should let jQ UI know.
|
||||
ui.item.after( ui.placeholder ); // reattach the placeholder.
|
||||
tempHolder.css('margin-top', 0); // reset the margin
|
||||
|
||||
// Now that the element is complete, we can update...
|
||||
updateSharedVars(ui);
|
||||
},
|
||||
stop: function(e, ui) {
|
||||
var children, depthChange = currentDepth - originalDepth;
|
||||
|
||||
// Return child elements to the list
|
||||
children = transport.children().insertAfter(ui.item);
|
||||
|
||||
// Update depth classes
|
||||
if( depthChange != 0 ) {
|
||||
ui.item.updateDepthClass( currentDepth );
|
||||
children.shiftDepthClass( depthChange );
|
||||
updateMenuMaxDepth( depthChange );
|
||||
}
|
||||
// Register a change
|
||||
api.registerChange();
|
||||
// Update the item data.
|
||||
ui.item.updateParentMenuItemDBId();
|
||||
|
||||
// address sortable's incorrectly-calculated top in opera
|
||||
ui.item[0].style.top = 0;
|
||||
|
||||
// handle drop placement for rtl orientation
|
||||
if ( api.isRTL ) {
|
||||
ui.item[0].style.left = 'auto';
|
||||
ui.item[0].style.right = 0;
|
||||
}
|
||||
|
||||
// The width of the tab bar might have changed. Just in case.
|
||||
api.refreshMenuTabs( true );
|
||||
},
|
||||
change: function(e, ui) {
|
||||
// Make sure the placeholder is inside the menu.
|
||||
// Otherwise fix it, or we're in trouble.
|
||||
if( ! ui.placeholder.parent().hasClass('menu') )
|
||||
(prev.length) ? prev.after( ui.placeholder ) : api.menuList.prepend( ui.placeholder );
|
||||
|
||||
updateSharedVars(ui);
|
||||
},
|
||||
sort: function(e, ui) {
|
||||
var offset = ui.helper.offset(),
|
||||
edge = api.isRTL ? offset.left + ui.helper.width() : offset.left,
|
||||
depth = api.negateIfRTL * api.pxToDepth( edge - menuEdge );
|
||||
// Check and correct if depth is not within range.
|
||||
// Also, if the dragged element is dragged upwards over
|
||||
// an item, shift the placeholder to a child position.
|
||||
if ( depth > maxDepth || offset.top < prevBottom ) depth = maxDepth;
|
||||
else if ( depth < minDepth ) depth = minDepth;
|
||||
|
||||
if( depth != currentDepth )
|
||||
updateCurrentDepth(ui, depth);
|
||||
|
||||
// If we overlap the next element, manually shift downwards
|
||||
if( nextThreshold && offset.top + helperHeight > nextThreshold ) {
|
||||
next.after( ui.placeholder );
|
||||
updateSharedVars( ui );
|
||||
$(this).sortable( "refreshPositions" );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function updateSharedVars(ui) {
|
||||
var depth;
|
||||
|
||||
prev = ui.placeholder.prev();
|
||||
next = ui.placeholder.next();
|
||||
|
||||
// Make sure we don't select the moving item.
|
||||
if( prev[0] == ui.item[0] ) prev = prev.prev();
|
||||
if( next[0] == ui.item[0] ) next = next.next();
|
||||
|
||||
prevBottom = (prev.length) ? prev.offset().top + prev.height() : 0;
|
||||
nextThreshold = (next.length) ? next.offset().top + next.height() / 3 : 0;
|
||||
minDepth = (next.length) ? next.menuItemDepth() : 0;
|
||||
|
||||
if( prev.length )
|
||||
maxDepth = ( (depth = prev.menuItemDepth() + 1) > api.options.globalMaxDepth ) ? api.options.globalMaxDepth : depth;
|
||||
else
|
||||
maxDepth = 0;
|
||||
}
|
||||
|
||||
function updateCurrentDepth(ui, depth) {
|
||||
ui.placeholder.updateDepthClass( depth, currentDepth );
|
||||
currentDepth = depth;
|
||||
}
|
||||
|
||||
function initialMenuMaxDepth() {
|
||||
if( ! body[0].className ) return 0;
|
||||
var match = body[0].className.match(/menu-max-depth-(\d+)/);
|
||||
return match && match[1] ? parseInt(match[1]) : 0;
|
||||
}
|
||||
|
||||
function updateMenuMaxDepth( depthChange ) {
|
||||
var depth, newDepth = menuMaxDepth;
|
||||
if ( depthChange === 0 ) {
|
||||
return;
|
||||
} else if ( depthChange > 0 ) {
|
||||
depth = maxChildDepth + depthChange;
|
||||
if( depth > menuMaxDepth )
|
||||
newDepth = depth;
|
||||
} else if ( depthChange < 0 && maxChildDepth == menuMaxDepth ) {
|
||||
while( ! $('.menu-item-depth-' + newDepth, api.menuList).length && newDepth > 0 )
|
||||
newDepth--;
|
||||
}
|
||||
// Update the depth class.
|
||||
body.removeClass( 'menu-max-depth-' + menuMaxDepth ).addClass( 'menu-max-depth-' + newDepth );
|
||||
menuMaxDepth = newDepth;
|
||||
}
|
||||
},
|
||||
|
||||
attachMenuEditListeners : function() {
|
||||
var that = this;
|
||||
$('#update-nav-menu').bind('click', function(e) {
|
||||
if ( e.target && e.target.className ) {
|
||||
if ( -1 != e.target.className.indexOf('item-edit') ) {
|
||||
return that.eventOnClickEditLink(e.target);
|
||||
} else if ( -1 != e.target.className.indexOf('menu-save') ) {
|
||||
return that.eventOnClickMenuSave(e.target);
|
||||
} else if ( -1 != e.target.className.indexOf('menu-delete') ) {
|
||||
return that.eventOnClickMenuDelete(e.target);
|
||||
} else if ( -1 != e.target.className.indexOf('item-delete') ) {
|
||||
return that.eventOnClickMenuItemDelete(e.target);
|
||||
} else if ( -1 != e.target.className.indexOf('item-cancel') ) {
|
||||
return that.eventOnClickCancelLink(e.target);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#add-custom-links input[type="text"]').keypress(function(e){
|
||||
if ( e.keyCode === 13 ) {
|
||||
e.preventDefault();
|
||||
$("#submit-customlinkdiv").click();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* An interface for managing default values for input elements
|
||||
* that is both JS and accessibility-friendly.
|
||||
*
|
||||
* Input elements that add the class 'input-with-default-title'
|
||||
* will have their values set to the provided HTML title when empty.
|
||||
*/
|
||||
setupInputWithDefaultTitle : function() {
|
||||
var name = 'input-with-default-title';
|
||||
|
||||
$('.' + name).each( function(){
|
||||
var $t = $(this), title = $t.attr('title'), val = $t.val();
|
||||
$t.data( name, title );
|
||||
|
||||
if( '' == val ) $t.val( title );
|
||||
else if ( title == val ) return;
|
||||
else $t.removeClass( name );
|
||||
}).focus( function(){
|
||||
var $t = $(this);
|
||||
if( $t.val() == $t.data(name) )
|
||||
$t.val('').removeClass( name );
|
||||
}).blur( function(){
|
||||
var $t = $(this);
|
||||
if( '' == $t.val() )
|
||||
$t.addClass( name ).val( $t.data(name) );
|
||||
});
|
||||
},
|
||||
|
||||
attachThemeLocationsListeners : function() {
|
||||
var loc = $('#nav-menu-theme-locations'), params = {};
|
||||
params['action'] = 'menu-locations-save';
|
||||
params['menu-settings-column-nonce'] = $('#menu-settings-column-nonce').val();
|
||||
loc.find('input[type="submit"]').click(function() {
|
||||
loc.find('select').each(function() {
|
||||
params[this.name] = $(this).val();
|
||||
});
|
||||
loc.find('.waiting').show();
|
||||
$.post( ajaxurl, params, function(r) {
|
||||
loc.find('.waiting').hide();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
},
|
||||
|
||||
attachQuickSearchListeners : function() {
|
||||
var searchTimer;
|
||||
|
||||
$('.quick-search').keypress(function(e){
|
||||
var t = $(this);
|
||||
|
||||
if( 13 == e.which ) {
|
||||
api.updateQuickSearchResults( t );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( searchTimer ) clearTimeout(searchTimer);
|
||||
|
||||
searchTimer = setTimeout(function(){
|
||||
api.updateQuickSearchResults( t );
|
||||
}, 400);
|
||||
}).attr('autocomplete','off');
|
||||
},
|
||||
|
||||
updateQuickSearchResults : function(input) {
|
||||
var panel, params,
|
||||
minSearchLength = 2,
|
||||
q = input.val();
|
||||
|
||||
if( q.length < minSearchLength ) return;
|
||||
|
||||
panel = input.parents('.tabs-panel');
|
||||
params = {
|
||||
'action': 'menu-quick-search',
|
||||
'response-format': 'markup',
|
||||
'menu': $('#menu').val(),
|
||||
'menu-settings-column-nonce': $('#menu-settings-column-nonce').val(),
|
||||
'q': q,
|
||||
'type': input.attr('name')
|
||||
};
|
||||
|
||||
$('img.waiting', panel).show();
|
||||
|
||||
$.post( ajaxurl, params, function(menuMarkup) {
|
||||
api.processQuickSearchQueryResponse(menuMarkup, params, panel);
|
||||
});
|
||||
},
|
||||
|
||||
addCustomLink : function( processMethod ) {
|
||||
var url = $('#custom-menu-item-url').val(),
|
||||
label = $('#custom-menu-item-name').val();
|
||||
|
||||
processMethod = processMethod || api.addMenuItemToBottom;
|
||||
|
||||
if ( '' == url || 'http://' == url )
|
||||
return false;
|
||||
|
||||
// Show the ajax spinner
|
||||
$('.customlinkdiv img.waiting').show();
|
||||
this.addLinkToMenu( url, label, processMethod, function() {
|
||||
// Remove the ajax spinner
|
||||
$('.customlinkdiv img.waiting').hide();
|
||||
// Set custom link form back to defaults
|
||||
$('#custom-menu-item-name').val('').blur();
|
||||
$('#custom-menu-item-url').val('http://');
|
||||
});
|
||||
},
|
||||
|
||||
addLinkToMenu : function(url, label, processMethod, callback) {
|
||||
processMethod = processMethod || api.addMenuItemToBottom;
|
||||
callback = callback || function(){};
|
||||
|
||||
api.addItemToMenu({
|
||||
'-1': {
|
||||
'menu-item-type': 'custom',
|
||||
'menu-item-url': url,
|
||||
'menu-item-title': label
|
||||
}
|
||||
}, processMethod, callback);
|
||||
},
|
||||
|
||||
addItemToMenu : function(menuItem, processMethod, callback) {
|
||||
var menu = $('#menu').val(),
|
||||
nonce = $('#menu-settings-column-nonce').val();
|
||||
|
||||
processMethod = processMethod || function(){};
|
||||
callback = callback || function(){};
|
||||
|
||||
params = {
|
||||
'action': 'add-menu-item',
|
||||
'menu': menu,
|
||||
'menu-settings-column-nonce': nonce,
|
||||
'menu-item': menuItem
|
||||
};
|
||||
|
||||
$.post( ajaxurl, params, function(menuMarkup) {
|
||||
var ins = $('#menu-instructions');
|
||||
processMethod(menuMarkup, params);
|
||||
if( ! ins.hasClass('menu-instructions-inactive') && ins.siblings().length )
|
||||
ins.addClass('menu-instructions-inactive');
|
||||
callback();
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Process the add menu item request response into menu list item.
|
||||
*
|
||||
* @param string menuMarkup The text server response of menu item markup.
|
||||
* @param object req The request arguments.
|
||||
*/
|
||||
addMenuItemToBottom : function( menuMarkup, req ) {
|
||||
$(menuMarkup).hideAdvancedMenuItemFields().appendTo( api.targetList );
|
||||
},
|
||||
|
||||
addMenuItemToTop : function( menuMarkup, req ) {
|
||||
$(menuMarkup).hideAdvancedMenuItemFields().prependTo( api.targetList );
|
||||
},
|
||||
|
||||
attachUnsavedChangesListener : function() {
|
||||
$('#menu-management input, #menu-management select, #menu-management, #menu-management textarea').change(function(){
|
||||
api.registerChange();
|
||||
});
|
||||
|
||||
if ( 0 != $('#menu-to-edit').length ) {
|
||||
window.onbeforeunload = function(){
|
||||
if ( api.menusChanged )
|
||||
return navMenuL10n.saveAlert;
|
||||
};
|
||||
} else {
|
||||
// Make the post boxes read-only, as they can't be used yet
|
||||
$('#menu-settings-column').find('input,select').prop('disabled', true).end().find('a').attr('href', '#').unbind('click');
|
||||
}
|
||||
},
|
||||
|
||||
registerChange : function() {
|
||||
api.menusChanged = true;
|
||||
},
|
||||
|
||||
attachTabsPanelListeners : function() {
|
||||
$('#menu-settings-column').bind('click', function(e) {
|
||||
var selectAreaMatch, panelId, wrapper, items,
|
||||
target = $(e.target);
|
||||
|
||||
if ( target.hasClass('nav-tab-link') ) {
|
||||
panelId = /#(.*)$/.exec(e.target.href);
|
||||
if ( panelId && panelId[1] )
|
||||
panelId = panelId[1]
|
||||
else
|
||||
return false;
|
||||
|
||||
wrapper = target.parents('.inside').first();
|
||||
|
||||
// upon changing tabs, we want to uncheck all checkboxes
|
||||
$('input', wrapper).removeAttr('checked');
|
||||
|
||||
$('.tabs-panel-active', wrapper).removeClass('tabs-panel-active').addClass('tabs-panel-inactive');
|
||||
$('#' + panelId, wrapper).removeClass('tabs-panel-inactive').addClass('tabs-panel-active');
|
||||
|
||||
$('.tabs', wrapper).removeClass('tabs');
|
||||
target.parent().addClass('tabs');
|
||||
|
||||
// select the search bar
|
||||
$('.quick-search', wrapper).focus();
|
||||
|
||||
return false;
|
||||
} else if ( target.hasClass('select-all') ) {
|
||||
selectAreaMatch = /#(.*)$/.exec(e.target.href);
|
||||
if ( selectAreaMatch && selectAreaMatch[1] ) {
|
||||
items = $('#' + selectAreaMatch[1] + ' .tabs-panel-active .menu-item-title input');
|
||||
if( items.length === items.filter(':checked').length )
|
||||
items.removeAttr('checked');
|
||||
else
|
||||
items.prop('checked', true);
|
||||
return false;
|
||||
}
|
||||
} else if ( target.hasClass('submit-add-to-menu') ) {
|
||||
api.registerChange();
|
||||
|
||||
if ( e.target.id && 'submit-customlinkdiv' == e.target.id )
|
||||
api.addCustomLink( api.addMenuItemToBottom );
|
||||
else if ( e.target.id && -1 != e.target.id.indexOf('submit-') )
|
||||
$('#' + e.target.id.replace(/submit-/, '')).addSelectedToMenu( api.addMenuItemToBottom );
|
||||
return false;
|
||||
} else if ( target.hasClass('page-numbers') ) {
|
||||
$.post( ajaxurl, e.target.href.replace(/.*\?/, '').replace(/action=([^&]*)/, '') + '&action=menu-get-metabox',
|
||||
function( resp ) {
|
||||
if ( -1 == resp.indexOf('replace-id') )
|
||||
return;
|
||||
|
||||
var metaBoxData = $.parseJSON(resp),
|
||||
toReplace = document.getElementById(metaBoxData['replace-id']),
|
||||
placeholder = document.createElement('div'),
|
||||
wrap = document.createElement('div');
|
||||
|
||||
if ( ! metaBoxData['markup'] || ! toReplace )
|
||||
return;
|
||||
|
||||
wrap.innerHTML = metaBoxData['markup'] ? metaBoxData['markup'] : '';
|
||||
|
||||
toReplace.parentNode.insertBefore( placeholder, toReplace );
|
||||
placeholder.parentNode.removeChild( toReplace );
|
||||
|
||||
placeholder.parentNode.insertBefore( wrap, placeholder );
|
||||
|
||||
placeholder.parentNode.removeChild( placeholder );
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
initTabManager : function() {
|
||||
var fixed = $('.nav-tabs-wrapper'),
|
||||
fluid = fixed.children('.nav-tabs'),
|
||||
active = fluid.children('.nav-tab-active'),
|
||||
tabs = fluid.children('.nav-tab'),
|
||||
tabsWidth = 0,
|
||||
fixedRight, fixedLeft,
|
||||
arrowLeft, arrowRight, resizeTimer, css = {},
|
||||
marginFluid = api.isRTL ? 'margin-right' : 'margin-left',
|
||||
marginFixed = api.isRTL ? 'margin-left' : 'margin-right',
|
||||
msPerPx = 2;
|
||||
|
||||
/**
|
||||
* Refreshes the menu tabs.
|
||||
* Will show and hide arrows where necessary.
|
||||
* Scrolls to the active tab by default.
|
||||
*
|
||||
* @param savePosition {boolean} Optional. Prevents scrolling so
|
||||
* that the current position is maintained. Default false.
|
||||
**/
|
||||
api.refreshMenuTabs = function( savePosition ) {
|
||||
var fixedWidth = fixed.width(),
|
||||
margin = 0, css = {};
|
||||
fixedLeft = fixed.offset().left;
|
||||
fixedRight = fixedLeft + fixedWidth;
|
||||
|
||||
if( !savePosition )
|
||||
active.makeTabVisible();
|
||||
|
||||
// Prevent space from building up next to the last tab if there's more to show
|
||||
if( tabs.last().isTabVisible() ) {
|
||||
margin = fixed.width() - tabsWidth;
|
||||
margin = margin > 0 ? 0 : margin;
|
||||
css[marginFluid] = margin + 'px';
|
||||
fluid.animate( css, 100, "linear" );
|
||||
}
|
||||
|
||||
// Show the arrows only when necessary
|
||||
if( fixedWidth > tabsWidth )
|
||||
arrowLeft.add( arrowRight ).hide();
|
||||
else
|
||||
arrowLeft.add( arrowRight ).show();
|
||||
}
|
||||
|
||||
$.fn.extend({
|
||||
makeTabVisible : function() {
|
||||
var t = this.eq(0), left, right, css = {}, shift = 0;
|
||||
|
||||
if( ! t.length ) return this;
|
||||
|
||||
left = t.offset().left;
|
||||
right = left + t.outerWidth();
|
||||
|
||||
if( right > fixedRight )
|
||||
shift = fixedRight - right;
|
||||
else if ( left < fixedLeft )
|
||||
shift = fixedLeft - left;
|
||||
|
||||
if( ! shift ) return this;
|
||||
|
||||
css[marginFluid] = "+=" + api.negateIfRTL * shift + 'px';
|
||||
fluid.animate( css, Math.abs( shift ) * msPerPx, "linear" );
|
||||
return this;
|
||||
},
|
||||
isTabVisible : function() {
|
||||
var t = this.eq(0),
|
||||
left = t.offset().left,
|
||||
right = left + t.outerWidth();
|
||||
return ( right <= fixedRight && left >= fixedLeft ) ? true : false;
|
||||
}
|
||||
});
|
||||
|
||||
// Find the width of all tabs
|
||||
tabs.each(function(){
|
||||
tabsWidth += $(this).outerWidth(true);
|
||||
});
|
||||
|
||||
// Set up fixed margin for overflow, unset padding
|
||||
css['padding'] = 0;
|
||||
css[marginFixed] = (-1 * tabsWidth) + 'px';
|
||||
fluid.css( css );
|
||||
|
||||
// Build tab navigation
|
||||
arrowLeft = $('<div class="nav-tabs-arrow nav-tabs-arrow-left"><a>«</a></div>');
|
||||
arrowRight = $('<div class="nav-tabs-arrow nav-tabs-arrow-right"><a>»</a></div>');
|
||||
// Attach to the document
|
||||
fixed.wrap('<div class="nav-tabs-nav"/>').parent().prepend( arrowLeft ).append( arrowRight );
|
||||
|
||||
// Set the menu tabs
|
||||
api.refreshMenuTabs();
|
||||
// Make sure the tabs reset on resize
|
||||
$(window).resize(function() {
|
||||
if( resizeTimer ) clearTimeout(resizeTimer);
|
||||
resizeTimer = setTimeout( api.refreshMenuTabs, 200);
|
||||
});
|
||||
|
||||
// Build arrow functions
|
||||
$.each([{
|
||||
arrow : arrowLeft,
|
||||
next : "next",
|
||||
last : "first",
|
||||
operator : "+="
|
||||
},{
|
||||
arrow : arrowRight,
|
||||
next : "prev",
|
||||
last : "last",
|
||||
operator : "-="
|
||||
}], function(){
|
||||
var that = this;
|
||||
this.arrow.mousedown(function(){
|
||||
var marginFluidVal = Math.abs( parseInt( fluid.css(marginFluid) ) ),
|
||||
shift = marginFluidVal,
|
||||
css = {};
|
||||
|
||||
if( "-=" == that.operator )
|
||||
shift = Math.abs( tabsWidth - fixed.width() ) - marginFluidVal;
|
||||
|
||||
if( ! shift ) return;
|
||||
|
||||
css[marginFluid] = that.operator + shift + 'px';
|
||||
fluid.animate( css, shift * msPerPx, "linear" );
|
||||
}).mouseup(function(){
|
||||
var tab, next;
|
||||
fluid.stop(true);
|
||||
tab = tabs[that.last]();
|
||||
while( (next = tab[that.next]()) && next.length && ! next.isTabVisible() ) {
|
||||
tab = next;
|
||||
}
|
||||
tab.makeTabVisible();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
eventOnClickEditLink : function(clickedEl) {
|
||||
var settings, item,
|
||||
matchedSection = /#(.*)$/.exec(clickedEl.href);
|
||||
if ( matchedSection && matchedSection[1] ) {
|
||||
settings = $('#'+matchedSection[1]);
|
||||
item = settings.parent();
|
||||
if( 0 != item.length ) {
|
||||
if( item.hasClass('menu-item-edit-inactive') ) {
|
||||
if( ! settings.data('menu-item-data') ) {
|
||||
settings.data( 'menu-item-data', settings.getItemData() );
|
||||
}
|
||||
settings.slideDown('fast');
|
||||
item.removeClass('menu-item-edit-inactive')
|
||||
.addClass('menu-item-edit-active');
|
||||
} else {
|
||||
settings.slideUp('fast');
|
||||
item.removeClass('menu-item-edit-active')
|
||||
.addClass('menu-item-edit-inactive');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
eventOnClickCancelLink : function(clickedEl) {
|
||||
var settings = $(clickedEl).closest('.menu-item-settings');
|
||||
settings.setItemData( settings.data('menu-item-data') );
|
||||
return false;
|
||||
},
|
||||
|
||||
eventOnClickMenuSave : function(clickedEl) {
|
||||
var locs = '',
|
||||
menuName = $('#menu-name'),
|
||||
menuNameVal = menuName.val();
|
||||
// Cancel and warn if invalid menu name
|
||||
if( !menuNameVal || menuNameVal == menuName.attr('title') || !menuNameVal.replace(/\s+/, '') ) {
|
||||
menuName.parent().addClass('form-invalid');
|
||||
return false;
|
||||
}
|
||||
// Copy menu theme locations
|
||||
$('#nav-menu-theme-locations select').each(function() {
|
||||
locs += '<input type="hidden" name="' + this.name + '" value="' + $(this).val() + '" />';
|
||||
});
|
||||
$('#update-nav-menu').append( locs );
|
||||
// Update menu item position data
|
||||
api.menuList.find('.menu-item-data-position').val( function(index) { return index + 1; } );
|
||||
window.onbeforeunload = null;
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
eventOnClickMenuDelete : function(clickedEl) {
|
||||
// Delete warning AYS
|
||||
if ( confirm( navMenuL10n.warnDeleteMenu ) ) {
|
||||
window.onbeforeunload = null;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
eventOnClickMenuItemDelete : function(clickedEl) {
|
||||
var itemID = parseInt(clickedEl.id.replace('delete-', ''), 10);
|
||||
api.removeMenuItem( $('#menu-item-' + itemID) );
|
||||
api.registerChange();
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Process the quick search response into a search result
|
||||
*
|
||||
* @param string resp The server response to the query.
|
||||
* @param object req The request arguments.
|
||||
* @param jQuery panel The tabs panel we're searching in.
|
||||
*/
|
||||
processQuickSearchQueryResponse : function(resp, req, panel) {
|
||||
var matched, newID,
|
||||
takenIDs = {},
|
||||
form = document.getElementById('nav-menu-meta'),
|
||||
pattern = new RegExp('menu-item\\[(\[^\\]\]*)', 'g'),
|
||||
$items = $('<div>').html(resp).find('li'),
|
||||
$item;
|
||||
|
||||
if( ! $items.length ) {
|
||||
$('.categorychecklist', panel).html( '<li><p>' + navMenuL10n.noResultsFound + '</p></li>' );
|
||||
$('img.waiting', panel).hide();
|
||||
return;
|
||||
}
|
||||
|
||||
$items.each(function(){
|
||||
$item = $(this);
|
||||
|
||||
// make a unique DB ID number
|
||||
matched = pattern.exec($item.html());
|
||||
|
||||
if ( matched && matched[1] ) {
|
||||
newID = matched[1];
|
||||
while( form.elements['menu-item[' + newID + '][menu-item-type]'] || takenIDs[ newID ] ) {
|
||||
newID--;
|
||||
}
|
||||
|
||||
takenIDs[newID] = true;
|
||||
if ( newID != matched[1] ) {
|
||||
$item.html( $item.html().replace(new RegExp(
|
||||
'menu-item\\[' + matched[1] + '\\]', 'g'),
|
||||
'menu-item[' + newID + ']'
|
||||
) );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.categorychecklist', panel).html( $items );
|
||||
$('img.waiting', panel).hide();
|
||||
},
|
||||
|
||||
removeMenuItem : function(el) {
|
||||
var children = el.childMenuItems();
|
||||
|
||||
el.addClass('deleting').animate({
|
||||
opacity : 0,
|
||||
height: 0
|
||||
}, 350, function() {
|
||||
var ins = $('#menu-instructions');
|
||||
el.remove();
|
||||
children.shiftDepthClass(-1).updateParentMenuItemDBId();
|
||||
if( ! ins.siblings().length )
|
||||
ins.removeClass('menu-instructions-inactive');
|
||||
});
|
||||
},
|
||||
|
||||
depthToPx : function(depth) {
|
||||
return depth * api.options.menuItemDepthPerLevel;
|
||||
},
|
||||
|
||||
pxToDepth : function(px) {
|
||||
return Math.floor(px / api.options.menuItemDepthPerLevel);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$(document).ready(function(){ wpNavMenu.init(); });
|
||||
|
||||
})(jQuery);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,36 +0,0 @@
|
|||
// Password strength meter
|
||||
function passwordStrength(password1, username, password2) {
|
||||
var shortPass = 1, badPass = 2, goodPass = 3, strongPass = 4, mismatch = 5, symbolSize = 0, natLog, score;
|
||||
|
||||
// password 1 != password 2
|
||||
if ( (password1 != password2) && password2.length > 0)
|
||||
return mismatch
|
||||
|
||||
//password < 4
|
||||
if ( password1.length < 4 )
|
||||
return shortPass
|
||||
|
||||
//password1 == username
|
||||
if ( password1.toLowerCase() == username.toLowerCase() )
|
||||
return badPass;
|
||||
|
||||
if ( password1.match(/[0-9]/) )
|
||||
symbolSize +=10;
|
||||
if ( password1.match(/[a-z]/) )
|
||||
symbolSize +=26;
|
||||
if ( password1.match(/[A-Z]/) )
|
||||
symbolSize +=26;
|
||||
if ( password1.match(/[^a-zA-Z0-9]/) )
|
||||
symbolSize +=31;
|
||||
|
||||
natLog = Math.log( Math.pow(symbolSize, password1.length) );
|
||||
score = natLog / Math.LN2;
|
||||
|
||||
if (score < 40 )
|
||||
return badPass
|
||||
|
||||
if (score < 56 )
|
||||
return goodPass
|
||||
|
||||
return strongPass;
|
||||
}
|
|
@ -1 +1,36 @@
|
|||
function passwordStrength(f,i,d){var k=1,h=2,b=3,a=4,c=5,g=0,j,e;if((f!=d)&&d.length>0){return c}if(f.length<4){return k}if(f.toLowerCase()==i.toLowerCase()){return h}if(f.match(/[0-9]/)){g+=10}if(f.match(/[a-z]/)){g+=26}if(f.match(/[A-Z]/)){g+=26}if(f.match(/[^a-zA-Z0-9]/)){g+=31}j=Math.log(Math.pow(g,f.length));e=j/Math.LN2;if(e<40){return h}if(e<56){return b}return a};
|
||||
// Password strength meter
|
||||
function passwordStrength(password1, username, password2) {
|
||||
var shortPass = 1, badPass = 2, goodPass = 3, strongPass = 4, mismatch = 5, symbolSize = 0, natLog, score;
|
||||
|
||||
// password 1 != password 2
|
||||
if ( (password1 != password2) && password2.length > 0)
|
||||
return mismatch
|
||||
|
||||
//password < 4
|
||||
if ( password1.length < 4 )
|
||||
return shortPass
|
||||
|
||||
//password1 == username
|
||||
if ( password1.toLowerCase() == username.toLowerCase() )
|
||||
return badPass;
|
||||
|
||||
if ( password1.match(/[0-9]/) )
|
||||
symbolSize +=10;
|
||||
if ( password1.match(/[a-z]/) )
|
||||
symbolSize +=26;
|
||||
if ( password1.match(/[A-Z]/) )
|
||||
symbolSize +=26;
|
||||
if ( password1.match(/[^a-zA-Z0-9]/) )
|
||||
symbolSize +=31;
|
||||
|
||||
natLog = Math.log( Math.pow(symbolSize, password1.length) );
|
||||
score = natLog / Math.LN2;
|
||||
|
||||
if (score < 40 )
|
||||
return badPass
|
||||
|
||||
if (score < 56 )
|
||||
return goodPass
|
||||
|
||||
return strongPass;
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
function passwordStrength(f,i,d){var k=1,h=2,b=3,a=4,c=5,g=0,j,e;if((f!=d)&&d.length>0){return c}if(f.length<4){return k}if(f.toLowerCase()==i.toLowerCase()){return h}if(f.match(/[0-9]/)){g+=10}if(f.match(/[a-z]/)){g+=26}if(f.match(/[A-Z]/)){g+=26}if(f.match(/[^a-zA-Z0-9]/)){g+=31}j=Math.log(Math.pow(g,f.length));e=j/Math.LN2;if(e<40){return h}if(e<56){return b}return a};
|
|
@ -1,53 +0,0 @@
|
|||
/* Plugin Browser Thickbox related JS*/
|
||||
var tb_position;
|
||||
jQuery(document).ready(function($) {
|
||||
tb_position = function() {
|
||||
var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width, adminbar_height = 0;
|
||||
|
||||
if ( $('body.admin-bar').length )
|
||||
adminbar_height = 28;
|
||||
|
||||
if ( tbWindow.size() ) {
|
||||
tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
|
||||
$('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
|
||||
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
|
||||
if ( typeof document.body.style.maxWidth != 'undefined' )
|
||||
tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
|
||||
};
|
||||
|
||||
return $('a.thickbox').each( function() {
|
||||
var href = $(this).attr('href');
|
||||
if ( ! href )
|
||||
return;
|
||||
href = href.replace(/&width=[0-9]+/g, '');
|
||||
href = href.replace(/&height=[0-9]+/g, '');
|
||||
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 - adminbar_height ) );
|
||||
});
|
||||
};
|
||||
|
||||
$(window).resize(function(){ tb_position(); });
|
||||
|
||||
$('#dashboard_plugins a.thickbox, .plugins a.thickbox').click( function() {
|
||||
tb_click.call(this);
|
||||
|
||||
$('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
|
||||
$('#TB_ajaxWindowTitle').html('<strong>' + plugininstallL10n.plugin_information + '</strong> ' + $(this).attr('title') );
|
||||
return false;
|
||||
});
|
||||
|
||||
/* Plugin install related JS*/
|
||||
$('#plugin-information #sidemenu a').click( function() {
|
||||
var tab = $(this).attr('name');
|
||||
//Flip the tab
|
||||
$('#plugin-information-header a.current').removeClass('current');
|
||||
$(this).addClass('current');
|
||||
//Flip the content.
|
||||
$('#section-holder div.section').hide(); //Hide 'em all
|
||||
$('#section-' + tab).show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a.install-now').click( function() {
|
||||
return confirm( plugininstallL10n.ays );
|
||||
});
|
||||
});
|
|
@ -1 +1,53 @@
|
|||
var tb_position;jQuery(document).ready(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()});a("#dashboard_plugins a.thickbox, .plugins a.thickbox").click(function(){tb_click.call(this);a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});a("#TB_ajaxWindowTitle").html("<strong>"+plugininstallL10n.plugin_information+"</strong> "+a(this).attr("title"));return false});a("#plugin-information #sidemenu a").click(function(){var b=a(this).attr("name");a("#plugin-information-header a.current").removeClass("current");a(this).addClass("current");a("#section-holder div.section").hide();a("#section-"+b).show();return false});a("a.install-now").click(function(){return confirm(plugininstallL10n.ays)})});
|
||||
/* Plugin Browser Thickbox related JS*/
|
||||
var tb_position;
|
||||
jQuery(document).ready(function($) {
|
||||
tb_position = function() {
|
||||
var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width, adminbar_height = 0;
|
||||
|
||||
if ( $('body.admin-bar').length )
|
||||
adminbar_height = 28;
|
||||
|
||||
if ( tbWindow.size() ) {
|
||||
tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
|
||||
$('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
|
||||
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
|
||||
if ( typeof document.body.style.maxWidth != 'undefined' )
|
||||
tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
|
||||
};
|
||||
|
||||
return $('a.thickbox').each( function() {
|
||||
var href = $(this).attr('href');
|
||||
if ( ! href )
|
||||
return;
|
||||
href = href.replace(/&width=[0-9]+/g, '');
|
||||
href = href.replace(/&height=[0-9]+/g, '');
|
||||
$(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 - adminbar_height ) );
|
||||
});
|
||||
};
|
||||
|
||||
$(window).resize(function(){ tb_position(); });
|
||||
|
||||
$('#dashboard_plugins a.thickbox, .plugins a.thickbox').click( function() {
|
||||
tb_click.call(this);
|
||||
|
||||
$('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
|
||||
$('#TB_ajaxWindowTitle').html('<strong>' + plugininstallL10n.plugin_information + '</strong> ' + $(this).attr('title') );
|
||||
return false;
|
||||
});
|
||||
|
||||
/* Plugin install related JS*/
|
||||
$('#plugin-information #sidemenu a').click( function() {
|
||||
var tab = $(this).attr('name');
|
||||
//Flip the tab
|
||||
$('#plugin-information-header a.current').removeClass('current');
|
||||
$(this).addClass('current');
|
||||
//Flip the content.
|
||||
$('#section-holder div.section').hide(); //Hide 'em all
|
||||
$('#section-' + tab).show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a.install-now').click( function() {
|
||||
return confirm( plugininstallL10n.ays );
|
||||
});
|
||||
});
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
var tb_position;jQuery(document).ready(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()});a("#dashboard_plugins a.thickbox, .plugins a.thickbox").click(function(){tb_click.call(this);a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});a("#TB_ajaxWindowTitle").html("<strong>"+plugininstallL10n.plugin_information+"</strong> "+a(this).attr("title"));return false});a("#plugin-information #sidemenu a").click(function(){var b=a(this).attr("name");a("#plugin-information-header a.current").removeClass("current");a(this).addClass("current");a("#section-holder div.section").hide();a("#section-"+b).show();return false});a("a.install-now").click(function(){return confirm(plugininstallL10n.ays)})});
|
|
@ -1,663 +0,0 @@
|
|||
var tagBox, commentsBox, editPermalink, makeSlugeditClickable, WPSetThumbnailHTML, WPSetThumbnailID, WPRemoveThumbnail, wptitlehint;
|
||||
|
||||
// return an array with any duplicate, whitespace or values removed
|
||||
function array_unique_noempty(a) {
|
||||
var out = [];
|
||||
jQuery.each( a, function(key, val) {
|
||||
val = jQuery.trim(val);
|
||||
if ( val && jQuery.inArray(val, out) == -1 )
|
||||
out.push(val);
|
||||
} );
|
||||
return out;
|
||||
}
|
||||
|
||||
(function($){
|
||||
|
||||
tagBox = {
|
||||
clean : function(tags) {
|
||||
var comma = postL10n.comma;
|
||||
if ( ',' !== comma )
|
||||
tags = tags.replace(new RegExp(comma, 'g'), ',');
|
||||
tags = tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
|
||||
if ( ',' !== comma )
|
||||
tags = tags.replace(/,/g, comma);
|
||||
return tags;
|
||||
},
|
||||
|
||||
parseTags : function(el) {
|
||||
var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'),
|
||||
thetags = taxbox.find('.the-tags'), comma = postL10n.comma,
|
||||
current_tags = thetags.val().split(comma), new_tags = [];
|
||||
delete current_tags[num];
|
||||
|
||||
$.each( current_tags, function(key, val) {
|
||||
val = $.trim(val);
|
||||
if ( val ) {
|
||||
new_tags.push(val);
|
||||
}
|
||||
});
|
||||
|
||||
thetags.val( this.clean( new_tags.join(comma) ) );
|
||||
|
||||
this.quickClicks(taxbox);
|
||||
return false;
|
||||
},
|
||||
|
||||
quickClicks : function(el) {
|
||||
var thetags = $('.the-tags', el),
|
||||
tagchecklist = $('.tagchecklist', el),
|
||||
id = $(el).attr('id'),
|
||||
current_tags, disabled;
|
||||
|
||||
if ( !thetags.length )
|
||||
return;
|
||||
|
||||
disabled = thetags.prop('disabled');
|
||||
|
||||
current_tags = thetags.val().split(postL10n.comma);
|
||||
tagchecklist.empty();
|
||||
|
||||
$.each( current_tags, function( key, val ) {
|
||||
var span, xbutton;
|
||||
|
||||
val = $.trim( val );
|
||||
|
||||
if ( ! val )
|
||||
return;
|
||||
|
||||
// Create a new span, and ensure the text is properly escaped.
|
||||
span = $('<span />').text( val );
|
||||
|
||||
// If tags editing isn't disabled, create the X button.
|
||||
if ( ! disabled ) {
|
||||
xbutton = $( '<a id="' + id + '-check-num-' + key + '" class="ntdelbutton">X</a>' );
|
||||
xbutton.click( function(){ tagBox.parseTags(this); });
|
||||
span.prepend(' ').prepend( xbutton );
|
||||
}
|
||||
|
||||
// Append the span to the tag list.
|
||||
tagchecklist.append( span );
|
||||
});
|
||||
},
|
||||
|
||||
flushTags : function(el, a, f) {
|
||||
a = a || false;
|
||||
var tags = $('.the-tags', el),
|
||||
newtag = $('input.newtag', el),
|
||||
comma = postL10n.comma,
|
||||
newtags, text;
|
||||
|
||||
text = a ? $(a).text() : newtag.val();
|
||||
tagsval = tags.val();
|
||||
newtags = tagsval ? tagsval + comma + text : text;
|
||||
|
||||
newtags = this.clean( newtags );
|
||||
newtags = array_unique_noempty( newtags.split(comma) ).join(comma);
|
||||
tags.val(newtags);
|
||||
this.quickClicks(el);
|
||||
|
||||
if ( !a )
|
||||
newtag.val('');
|
||||
if ( 'undefined' == typeof(f) )
|
||||
newtag.focus();
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
get : function(id) {
|
||||
var tax = id.substr(id.indexOf('-')+1);
|
||||
|
||||
$.post(ajaxurl, {'action':'get-tagcloud', 'tax':tax}, function(r, stat) {
|
||||
if ( 0 == r || 'success' != stat )
|
||||
r = wpAjax.broken;
|
||||
|
||||
r = $('<p id="tagcloud-'+tax+'" class="the-tagcloud">'+r+'</p>');
|
||||
$('a', r).click(function(){
|
||||
tagBox.flushTags( $(this).closest('.inside').children('.tagsdiv'), this);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#'+id).after(r);
|
||||
});
|
||||
},
|
||||
|
||||
init : function() {
|
||||
var t = this, ajaxtag = $('div.ajaxtag');
|
||||
|
||||
$('.tagsdiv').each( function() {
|
||||
tagBox.quickClicks(this);
|
||||
});
|
||||
|
||||
$('input.tagadd', ajaxtag).click(function(){
|
||||
t.flushTags( $(this).closest('.tagsdiv') );
|
||||
});
|
||||
|
||||
$('div.taghint', ajaxtag).click(function(){
|
||||
$(this).css('visibility', 'hidden').parent().siblings('.newtag').focus();
|
||||
});
|
||||
|
||||
$('input.newtag', ajaxtag).blur(function() {
|
||||
if ( this.value == '' )
|
||||
$(this).parent().siblings('.taghint').css('visibility', '');
|
||||
}).focus(function(){
|
||||
$(this).parent().siblings('.taghint').css('visibility', 'hidden');
|
||||
}).keyup(function(e){
|
||||
if ( 13 == e.which ) {
|
||||
tagBox.flushTags( $(this).closest('.tagsdiv') );
|
||||
return false;
|
||||
}
|
||||
}).keypress(function(e){
|
||||
if ( 13 == e.which ) {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
}).each(function(){
|
||||
var tax = $(this).closest('div.tagsdiv').attr('id');
|
||||
$(this).suggest( ajaxurl + '?action=ajax-tag-search&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: postL10n.comma + ' ' } );
|
||||
});
|
||||
|
||||
// save tags on post save/publish
|
||||
$('#post').submit(function(){
|
||||
$('div.tagsdiv').each( function() {
|
||||
tagBox.flushTags(this, false, 1);
|
||||
});
|
||||
});
|
||||
|
||||
// tag cloud
|
||||
$('a.tagcloud-link').click(function(){
|
||||
tagBox.get( $(this).attr('id') );
|
||||
$(this).unbind().click(function(){
|
||||
$(this).siblings('.the-tagcloud').toggle();
|
||||
return false;
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
commentsBox = {
|
||||
st : 0,
|
||||
|
||||
get : function(total, num) {
|
||||
var st = this.st, data;
|
||||
if ( ! num )
|
||||
num = 20;
|
||||
|
||||
this.st += num;
|
||||
this.total = total;
|
||||
$('#commentsdiv img.waiting').show();
|
||||
|
||||
data = {
|
||||
'action' : 'get-comments',
|
||||
'mode' : 'single',
|
||||
'_ajax_nonce' : $('#add_comment_nonce').val(),
|
||||
'p' : $('#post_ID').val(),
|
||||
'start' : st,
|
||||
'number' : num
|
||||
};
|
||||
|
||||
$.post(ajaxurl, data,
|
||||
function(r) {
|
||||
r = wpAjax.parseAjaxResponse(r);
|
||||
$('#commentsdiv .widefat').show();
|
||||
$('#commentsdiv img.waiting').hide();
|
||||
|
||||
if ( 'object' == typeof r && r.responses[0] ) {
|
||||
$('#the-comment-list').append( r.responses[0].data );
|
||||
|
||||
theList = theExtraList = null;
|
||||
$("a[className*=':']").unbind();
|
||||
|
||||
if ( commentsBox.st > commentsBox.total )
|
||||
$('#show-comments').hide();
|
||||
else
|
||||
$('#show-comments').show().children('a').html(postL10n.showcomm);
|
||||
|
||||
return;
|
||||
} else if ( 1 == r ) {
|
||||
$('#show-comments').html(postL10n.endcomm);
|
||||
return;
|
||||
}
|
||||
|
||||
$('#the-comment-list').append('<tr><td colspan="2">'+wpAjax.broken+'</td></tr>');
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
WPSetThumbnailHTML = function(html){
|
||||
$('.inside', '#postimagediv').html(html);
|
||||
};
|
||||
|
||||
WPSetThumbnailID = function(id){
|
||||
var field = $('input[value="_thumbnail_id"]', '#list-table');
|
||||
if ( field.size() > 0 ) {
|
||||
$('#meta\\[' + field.attr('id').match(/[0-9]+/) + '\\]\\[value\\]').text(id);
|
||||
}
|
||||
};
|
||||
|
||||
WPRemoveThumbnail = function(nonce){
|
||||
$.post(ajaxurl, {
|
||||
action:"set-post-thumbnail", post_id: $('#post_ID').val(), thumbnail_id: -1, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie)
|
||||
}, function(str){
|
||||
if ( str == '0' ) {
|
||||
alert( setPostThumbnailL10n.error );
|
||||
} else {
|
||||
WPSetThumbnailHTML(str);
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
jQuery(document).ready( function($) {
|
||||
var stamp, visibility, sticky = '', last = 0, co = $('#content');
|
||||
|
||||
postboxes.add_postbox_toggles(pagenow);
|
||||
|
||||
// multi-taxonomies
|
||||
if ( $('#tagsdiv-post_tag').length ) {
|
||||
tagBox.init();
|
||||
} else {
|
||||
$('#side-sortables, #normal-sortables, #advanced-sortables').children('div.postbox').each(function(){
|
||||
if ( this.id.indexOf('tagsdiv-') === 0 ) {
|
||||
tagBox.init();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// categories
|
||||
$('.categorydiv').each( function(){
|
||||
var this_id = $(this).attr('id'), noSyncChecks = false, syncChecks, catAddAfter, taxonomyParts, taxonomy, settingName;
|
||||
|
||||
taxonomyParts = this_id.split('-');
|
||||
taxonomyParts.shift();
|
||||
taxonomy = taxonomyParts.join('-');
|
||||
settingName = taxonomy + '_tab';
|
||||
if ( taxonomy == 'category' )
|
||||
settingName = 'cats';
|
||||
|
||||
// TODO: move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.dev.js
|
||||
$('a', '#' + taxonomy + '-tabs').click( function(){
|
||||
var t = $(this).attr('href');
|
||||
$(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
|
||||
$('#' + taxonomy + '-tabs').siblings('.tabs-panel').hide();
|
||||
$(t).show();
|
||||
if ( '#' + taxonomy + '-all' == t )
|
||||
deleteUserSetting(settingName);
|
||||
else
|
||||
setUserSetting(settingName, 'pop');
|
||||
return false;
|
||||
});
|
||||
|
||||
if ( getUserSetting(settingName) )
|
||||
$('a[href="#' + taxonomy + '-pop"]', '#' + taxonomy + '-tabs').click();
|
||||
|
||||
// Ajax Cat
|
||||
$('#new' + taxonomy).one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ) } );
|
||||
$('#' + taxonomy + '-add-submit').click( function(){ $('#new' + taxonomy).focus(); });
|
||||
|
||||
syncChecks = function() {
|
||||
if ( noSyncChecks )
|
||||
return;
|
||||
noSyncChecks = true;
|
||||
var th = jQuery(this), c = th.is(':checked'), id = th.val().toString();
|
||||
$('#in-' + taxonomy + '-' + id + ', #in-' + taxonomy + '-category-' + id).prop( 'checked', c );
|
||||
noSyncChecks = false;
|
||||
};
|
||||
|
||||
catAddBefore = function( s ) {
|
||||
if ( !$('#new'+taxonomy).val() )
|
||||
return false;
|
||||
s.data += '&' + $( ':checked', '#'+taxonomy+'checklist' ).serialize();
|
||||
$( '#' + taxonomy + '-add-submit' ).prop( 'disabled', true );
|
||||
return s;
|
||||
};
|
||||
|
||||
catAddAfter = function( r, s ) {
|
||||
var sup, drop = $('#new'+taxonomy+'_parent');
|
||||
|
||||
$( '#' + taxonomy + '-add-submit' ).prop( 'disabled', false );
|
||||
if ( 'undefined' != s.parsed.responses[0] && (sup = s.parsed.responses[0].supplemental.newcat_parent) ) {
|
||||
drop.before(sup);
|
||||
drop.remove();
|
||||
}
|
||||
};
|
||||
|
||||
$('#' + taxonomy + 'checklist').wpList({
|
||||
alt: '',
|
||||
response: taxonomy + '-ajax-response',
|
||||
addBefore: catAddBefore,
|
||||
addAfter: catAddAfter
|
||||
});
|
||||
|
||||
$('#' + taxonomy + '-add-toggle').click( function() {
|
||||
$('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' );
|
||||
$('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').click();
|
||||
$('#new'+taxonomy).focus();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#' + taxonomy + 'checklist li.popular-category :checkbox, #' + taxonomy + 'checklist-pop :checkbox').live( 'click', function(){
|
||||
var t = $(this), c = t.is(':checked'), id = t.val();
|
||||
if ( id && t.parents('#taxonomy-'+taxonomy).length )
|
||||
$('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c );
|
||||
});
|
||||
|
||||
}); // end cats
|
||||
|
||||
// Custom Fields
|
||||
if ( $('#postcustom').length ) {
|
||||
$('#the-list').wpList( { addAfter: function( xml, s ) {
|
||||
$('table#list-table').show();
|
||||
}, addBefore: function( s ) {
|
||||
s.data += '&post_id=' + $('#post_ID').val();
|
||||
return s;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// submitdiv
|
||||
if ( $('#submitdiv').length ) {
|
||||
stamp = $('#timestamp').html();
|
||||
visibility = $('#post-visibility-display').html();
|
||||
|
||||
function updateVisibility() {
|
||||
var pvSelect = $('#post-visibility-select');
|
||||
if ( $('input:radio:checked', pvSelect).val() != 'public' ) {
|
||||
$('#sticky').prop('checked', false);
|
||||
$('#sticky-span').hide();
|
||||
} else {
|
||||
$('#sticky-span').show();
|
||||
}
|
||||
if ( $('input:radio:checked', pvSelect).val() != 'password' ) {
|
||||
$('#password-span').hide();
|
||||
} else {
|
||||
$('#password-span').show();
|
||||
}
|
||||
}
|
||||
|
||||
function updateText() {
|
||||
var attemptedDate, originalDate, currentDate, publishOn, postStatus = $('#post_status'),
|
||||
optPublish = $('option[value="publish"]', postStatus), aa = $('#aa').val(),
|
||||
mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val();
|
||||
|
||||
attemptedDate = new Date( aa, mm - 1, jj, hh, mn );
|
||||
originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val() );
|
||||
currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val() );
|
||||
|
||||
if ( attemptedDate.getFullYear() != aa || (1 + attemptedDate.getMonth()) != mm || attemptedDate.getDate() != jj || attemptedDate.getMinutes() != mn ) {
|
||||
$('.timestamp-wrap', '#timestampdiv').addClass('form-invalid');
|
||||
return false;
|
||||
} else {
|
||||
$('.timestamp-wrap', '#timestampdiv').removeClass('form-invalid');
|
||||
}
|
||||
|
||||
if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) {
|
||||
publishOn = postL10n.publishOnFuture;
|
||||
$('#publish').val( postL10n.schedule );
|
||||
} else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {
|
||||
publishOn = postL10n.publishOn;
|
||||
$('#publish').val( postL10n.publish );
|
||||
} else {
|
||||
publishOn = postL10n.publishOnPast;
|
||||
$('#publish').val( postL10n.update );
|
||||
}
|
||||
if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { //hack
|
||||
$('#timestamp').html(stamp);
|
||||
} else {
|
||||
$('#timestamp').html(
|
||||
publishOn + ' <b>' +
|
||||
$('option[value="' + $('#mm').val() + '"]', '#mm').text() + ' ' +
|
||||
jj + ', ' +
|
||||
aa + ' @ ' +
|
||||
hh + ':' +
|
||||
mn + '</b> '
|
||||
);
|
||||
}
|
||||
|
||||
if ( $('input:radio:checked', '#post-visibility-select').val() == 'private' ) {
|
||||
$('#publish').val( postL10n.update );
|
||||
if ( optPublish.length == 0 ) {
|
||||
postStatus.append('<option value="publish">' + postL10n.privatelyPublished + '</option>');
|
||||
} else {
|
||||
optPublish.html( postL10n.privatelyPublished );
|
||||
}
|
||||
$('option[value="publish"]', postStatus).prop('selected', true);
|
||||
$('.edit-post-status', '#misc-publishing-actions').hide();
|
||||
} else {
|
||||
if ( $('#original_post_status').val() == 'future' || $('#original_post_status').val() == 'draft' ) {
|
||||
if ( optPublish.length ) {
|
||||
optPublish.remove();
|
||||
postStatus.val($('#hidden_post_status').val());
|
||||
}
|
||||
} else {
|
||||
optPublish.html( postL10n.published );
|
||||
}
|
||||
if ( postStatus.is(':hidden') )
|
||||
$('.edit-post-status', '#misc-publishing-actions').show();
|
||||
}
|
||||
$('#post-status-display').html($('option:selected', postStatus).text());
|
||||
if ( $('option:selected', postStatus).val() == 'private' || $('option:selected', postStatus).val() == 'publish' ) {
|
||||
$('#save-post').hide();
|
||||
} else {
|
||||
$('#save-post').show();
|
||||
if ( $('option:selected', postStatus).val() == 'pending' ) {
|
||||
$('#save-post').show().val( postL10n.savePending );
|
||||
} else {
|
||||
$('#save-post').show().val( postL10n.saveDraft );
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
$('.edit-visibility', '#visibility').click(function () {
|
||||
if ($('#post-visibility-select').is(":hidden")) {
|
||||
updateVisibility();
|
||||
$('#post-visibility-select').slideDown('fast');
|
||||
$(this).hide();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.cancel-post-visibility', '#post-visibility-select').click(function () {
|
||||
$('#post-visibility-select').slideUp('fast');
|
||||
$('#visibility-radio-' + $('#hidden-post-visibility').val()).prop('checked', true);
|
||||
$('#post_password').val($('#hidden_post_password').val());
|
||||
$('#sticky').prop('checked', $('#hidden-post-sticky').prop('checked'));
|
||||
$('#post-visibility-display').html(visibility);
|
||||
$('.edit-visibility', '#visibility').show();
|
||||
updateText();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.save-post-visibility', '#post-visibility-select').click(function () { // crazyhorse - multiple ok cancels
|
||||
var pvSelect = $('#post-visibility-select');
|
||||
|
||||
pvSelect.slideUp('fast');
|
||||
$('.edit-visibility', '#visibility').show();
|
||||
updateText();
|
||||
|
||||
if ( $('input:radio:checked', pvSelect).val() != 'public' ) {
|
||||
$('#sticky').prop('checked', false);
|
||||
} // WEAPON LOCKED
|
||||
|
||||
if ( true == $('#sticky').prop('checked') ) {
|
||||
sticky = 'Sticky';
|
||||
} else {
|
||||
sticky = '';
|
||||
}
|
||||
|
||||
$('#post-visibility-display').html( postL10n[$('input:radio:checked', pvSelect).val() + sticky] );
|
||||
return false;
|
||||
});
|
||||
|
||||
$('input:radio', '#post-visibility-select').change(function() {
|
||||
updateVisibility();
|
||||
});
|
||||
|
||||
$('#timestampdiv').siblings('a.edit-timestamp').click(function() {
|
||||
if ($('#timestampdiv').is(":hidden")) {
|
||||
$('#timestampdiv').slideDown('fast');
|
||||
$(this).hide();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.cancel-timestamp', '#timestampdiv').click(function() {
|
||||
$('#timestampdiv').slideUp('fast');
|
||||
$('#mm').val($('#hidden_mm').val());
|
||||
$('#jj').val($('#hidden_jj').val());
|
||||
$('#aa').val($('#hidden_aa').val());
|
||||
$('#hh').val($('#hidden_hh').val());
|
||||
$('#mn').val($('#hidden_mn').val());
|
||||
$('#timestampdiv').siblings('a.edit-timestamp').show();
|
||||
updateText();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.save-timestamp', '#timestampdiv').click(function () { // crazyhorse - multiple ok cancels
|
||||
if ( updateText() ) {
|
||||
$('#timestampdiv').slideUp('fast');
|
||||
$('#timestampdiv').siblings('a.edit-timestamp').show();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#post-status-select').siblings('a.edit-post-status').click(function() {
|
||||
if ($('#post-status-select').is(":hidden")) {
|
||||
$('#post-status-select').slideDown('fast');
|
||||
$(this).hide();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.save-post-status', '#post-status-select').click(function() {
|
||||
$('#post-status-select').slideUp('fast');
|
||||
$('#post-status-select').siblings('a.edit-post-status').show();
|
||||
updateText();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.cancel-post-status', '#post-status-select').click(function() {
|
||||
$('#post-status-select').slideUp('fast');
|
||||
$('#post_status').val($('#hidden_post_status').val());
|
||||
$('#post-status-select').siblings('a.edit-post-status').show();
|
||||
updateText();
|
||||
return false;
|
||||
});
|
||||
} // end submitdiv
|
||||
|
||||
// permalink
|
||||
if ( $('#edit-slug-box').length ) {
|
||||
editPermalink = function(post_id) {
|
||||
var i, c = 0, e = $('#editable-post-name'), revert_e = e.html(), real_slug = $('#post_name'), revert_slug = real_slug.val(), b = $('#edit-slug-buttons'), revert_b = b.html(), full = $('#editable-post-name-full').html();
|
||||
|
||||
$('#view-post-btn').hide();
|
||||
b.html('<a href="#" class="save button">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+'</a>');
|
||||
b.children('.save').click(function() {
|
||||
var new_slug = e.children('input').val();
|
||||
if ( new_slug == $('#editable-post-name-full').text() ) {
|
||||
return $('.cancel', '#edit-slug-buttons').click();
|
||||
}
|
||||
$.post(ajaxurl, {
|
||||
action: 'sample-permalink',
|
||||
post_id: post_id,
|
||||
new_slug: new_slug,
|
||||
new_title: $('#title').val(),
|
||||
samplepermalinknonce: $('#samplepermalinknonce').val()
|
||||
}, function(data) {
|
||||
$('#edit-slug-box').html(data);
|
||||
b.html(revert_b);
|
||||
real_slug.val(new_slug);
|
||||
makeSlugeditClickable();
|
||||
$('#view-post-btn').show();
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.cancel', '#edit-slug-buttons').click(function() {
|
||||
$('#view-post-btn').show();
|
||||
e.html(revert_e);
|
||||
b.html(revert_b);
|
||||
real_slug.val(revert_slug);
|
||||
return false;
|
||||
});
|
||||
|
||||
for ( i = 0; i < full.length; ++i ) {
|
||||
if ( '%' == full.charAt(i) )
|
||||
c++;
|
||||
}
|
||||
|
||||
slug_value = ( c > full.length / 4 ) ? '' : full;
|
||||
e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e){
|
||||
var key = e.keyCode || 0;
|
||||
// on enter, just save the new slug, don't save the post
|
||||
if ( 13 == key ) {
|
||||
b.children('.save').click();
|
||||
return false;
|
||||
}
|
||||
if ( 27 == key ) {
|
||||
b.children('.cancel').click();
|
||||
return false;
|
||||
}
|
||||
real_slug.val(this.value);
|
||||
}).focus();
|
||||
}
|
||||
|
||||
makeSlugeditClickable = function() {
|
||||
$('#editable-post-name').click(function() {
|
||||
$('#edit-slug-buttons').children('.edit-slug').click();
|
||||
});
|
||||
}
|
||||
makeSlugeditClickable();
|
||||
}
|
||||
|
||||
// word count
|
||||
if ( typeof(wpWordCount) != 'undefined' ) {
|
||||
$(document).triggerHandler('wpcountwords', [ co.val() ]);
|
||||
|
||||
co.keyup( function(e) {
|
||||
var k = e.keyCode || e.charCode;
|
||||
|
||||
if ( k == last )
|
||||
return true;
|
||||
|
||||
if ( 13 == k || 8 == last || 46 == last )
|
||||
$(document).triggerHandler('wpcountwords', [ co.val() ]);
|
||||
|
||||
last = k;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
wptitlehint = function(id) {
|
||||
id = id || 'title';
|
||||
|
||||
var title = $('#' + id), titleprompt = $('#' + id + '-prompt-text');
|
||||
|
||||
if ( title.val() == '' )
|
||||
titleprompt.removeClass('screen-reader-text');
|
||||
|
||||
titleprompt.click(function(){
|
||||
$(this).addClass('screen-reader-text');
|
||||
title.focus();
|
||||
});
|
||||
|
||||
title.blur(function(){
|
||||
if ( this.value == '' )
|
||||
titleprompt.removeClass('screen-reader-text');
|
||||
}).focus(function(){
|
||||
titleprompt.addClass('screen-reader-text');
|
||||
}).keydown(function(e){
|
||||
titleprompt.addClass('screen-reader-text');
|
||||
$(this).unbind(e);
|
||||
});
|
||||
}
|
||||
|
||||
wptitlehint();
|
||||
});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,186 +0,0 @@
|
|||
var postboxes;
|
||||
|
||||
(function($) {
|
||||
postboxes = {
|
||||
add_postbox_toggles : function(page, args) {
|
||||
var self = this;
|
||||
|
||||
self.init(page, args);
|
||||
|
||||
$('.postbox h3, .postbox .handlediv').bind('click.postboxes', function() {
|
||||
var p = $(this).parent('.postbox'), id = p.attr('id');
|
||||
|
||||
if ( 'dashboard_browser_nag' == id )
|
||||
return;
|
||||
|
||||
p.toggleClass('closed');
|
||||
|
||||
if ( page != 'press-this' )
|
||||
self.save_state(page);
|
||||
|
||||
if ( id ) {
|
||||
if ( !p.hasClass('closed') && $.isFunction(postboxes.pbshow) )
|
||||
self.pbshow(id);
|
||||
else if ( p.hasClass('closed') && $.isFunction(postboxes.pbhide) )
|
||||
self.pbhide(id);
|
||||
}
|
||||
});
|
||||
|
||||
$('.postbox h3 a').click( function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
$('.postbox a.dismiss').bind('click.postboxes', function(e) {
|
||||
var hide_id = $(this).parents('.postbox').attr('id') + '-hide';
|
||||
$( '#' + hide_id ).prop('checked', false).triggerHandler('click');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.hide-postbox-tog').bind('click.postboxes', function() {
|
||||
var box = $(this).val();
|
||||
|
||||
if ( $(this).prop('checked') ) {
|
||||
$('#' + box).show();
|
||||
if ( $.isFunction( postboxes.pbshow ) )
|
||||
self.pbshow( box );
|
||||
} else {
|
||||
$('#' + box).hide();
|
||||
if ( $.isFunction( postboxes.pbhide ) )
|
||||
self.pbhide( box );
|
||||
}
|
||||
self.save_state(page);
|
||||
self._mark_area();
|
||||
});
|
||||
|
||||
$('.columns-prefs input[type="radio"]').bind('click.postboxes', function(){
|
||||
var n = parseInt($(this).val(), 10);
|
||||
|
||||
if ( n ) {
|
||||
self._pb_edit(n);
|
||||
self.save_order(page);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
init : function(page, args) {
|
||||
var isMobile = $(document.body).hasClass('mobile');
|
||||
|
||||
$.extend( this, args || {} );
|
||||
$('#wpbody-content').css('overflow','hidden');
|
||||
$('.meta-box-sortables').sortable({
|
||||
placeholder: 'sortable-placeholder',
|
||||
connectWith: '.meta-box-sortables',
|
||||
items: '.postbox',
|
||||
handle: '.hndle',
|
||||
cursor: 'move',
|
||||
delay: ( isMobile ? 200 : 0 ),
|
||||
distance: 2,
|
||||
tolerance: 'pointer',
|
||||
forcePlaceholderSize: true,
|
||||
helper: 'clone',
|
||||
opacity: 0.65,
|
||||
stop: function(e,ui) {
|
||||
if ( $(this).find('#dashboard_browser_nag').is(':visible') && 'dashboard_browser_nag' != this.firstChild.id ) {
|
||||
$(this).sortable('cancel');
|
||||
return;
|
||||
}
|
||||
|
||||
postboxes.save_order(page);
|
||||
},
|
||||
receive: function(e,ui) {
|
||||
if ( 'dashboard_browser_nag' == ui.item[0].id )
|
||||
$(ui.sender).sortable('cancel');
|
||||
|
||||
postboxes._mark_area();
|
||||
}
|
||||
});
|
||||
|
||||
if ( isMobile ) {
|
||||
$(document.body).bind('orientationchange.postboxes', function(){ postboxes._pb_change(); });
|
||||
this._pb_change();
|
||||
}
|
||||
|
||||
this._mark_area();
|
||||
},
|
||||
|
||||
save_state : function(page) {
|
||||
var closed = $('.postbox').filter('.closed').map(function() { return this.id; }).get().join(','),
|
||||
hidden = $('.postbox').filter(':hidden').map(function() { return this.id; }).get().join(',');
|
||||
|
||||
$.post(ajaxurl, {
|
||||
action: 'closed-postboxes',
|
||||
closed: closed,
|
||||
hidden: hidden,
|
||||
closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(),
|
||||
page: page
|
||||
});
|
||||
},
|
||||
|
||||
save_order : function(page) {
|
||||
var postVars, page_columns = $('.columns-prefs input:checked').val() || 0;
|
||||
|
||||
postVars = {
|
||||
action: 'meta-box-order',
|
||||
_ajax_nonce: $('#meta-box-order-nonce').val(),
|
||||
page_columns: page_columns,
|
||||
page: page
|
||||
}
|
||||
$('.meta-box-sortables').each( function() {
|
||||
postVars["order[" + this.id.split('-')[0] + "]"] = $(this).sortable( 'toArray' ).join(',');
|
||||
} );
|
||||
$.post( ajaxurl, postVars );
|
||||
},
|
||||
|
||||
_mark_area : function() {
|
||||
var visible = $('div.postbox:visible').length, side = $('#post-body #side-sortables');
|
||||
|
||||
$('#dashboard-widgets .meta-box-sortables:visible').each(function(n, el){
|
||||
var t = $(this);
|
||||
|
||||
if ( visible == 1 || t.children('.postbox:visible').length )
|
||||
t.removeClass('empty-container');
|
||||
else
|
||||
t.addClass('empty-container');
|
||||
});
|
||||
|
||||
if ( side.length ) {
|
||||
if ( side.children('.postbox:visible').length )
|
||||
side.removeClass('empty-container');
|
||||
else if ( $('#postbox-container-1').css('width') == '280px' )
|
||||
side.addClass('empty-container');
|
||||
}
|
||||
},
|
||||
|
||||
_pb_edit : function(n) {
|
||||
var el = $('.metabox-holder').get(0);
|
||||
el.className = el.className.replace(/columns-\d+/, 'columns-' + n);
|
||||
},
|
||||
|
||||
_pb_change : function() {
|
||||
var check = $( 'label.columns-prefs-1 input[type="radio"]' );
|
||||
|
||||
switch ( window.orientation ) {
|
||||
case 90:
|
||||
case -90:
|
||||
if ( !check.length || !check.is(':checked') )
|
||||
this._pb_edit(2);
|
||||
break;
|
||||
case 0:
|
||||
case 180:
|
||||
if ( $('#poststuff').length ) {
|
||||
this._pb_edit(1);
|
||||
} else {
|
||||
if ( !check.length || !check.is(':checked') )
|
||||
this._pb_edit(2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/* Callbacks */
|
||||
pbshow : false,
|
||||
|
||||
pbhide : false
|
||||
};
|
||||
|
||||
}(jQuery));
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue