diff --git a/css/jquery.qtip.min.css b/css/jquery.qtip.min.css deleted file mode 100644 index 947c8f9..0000000 --- a/css/jquery.qtip.min.css +++ /dev/null @@ -1 +0,0 @@ -.ui-tooltip,.qtip{position:absolute;left:-28000px;top:-28000px;display:none;max-width:280px;min-width:50px;font-size:10.5px;line-height:12px;}.ui-tooltip-fluid{display:block;visibility:hidden;position:static!important;float:left!important;}.ui-tooltip-content{position:relative;padding:5px 9px;overflow:hidden;border:1px solid #000001;text-align:left;word-wrap:break-word;overflow:hidden;}.ui-tooltip-titlebar{position:relative;min-height:14px;padding:5px 35px 5px 10px;overflow:hidden;border:1px solid #000001;border-width:1px 1px 0;font-weight:bold;}.ui-tooltip-titlebar+.ui-tooltip-content{border-top-width:0!important;}/*!Default close button class */ .ui-tooltip-titlebar .ui-state-default{position:absolute;right:4px;top:50%;margin-top:-9px;cursor:pointer;outline:medium none;border-width:1px;border-style:solid;}* html .ui-tooltip-titlebar .ui-state-default{top:16px;}.ui-tooltip-titlebar .ui-icon,.ui-tooltip-icon .ui-icon{display:block;text-indent:-1000em;}.ui-tooltip-icon,.ui-tooltip-icon .ui-icon{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.ui-tooltip-icon .ui-icon{width:18px;height:14px;text-align:center;text-indent:0;font:normal bold 10px/13px Tahoma,sans-serif;color:inherit;background:transparent none no-repeat -100em -100em;}/*!Default tooltip style */ .ui-tooltip-default .ui-tooltip-titlebar,.ui-tooltip-default .ui-tooltip-content{border-color:#F1D031;background-color:#FFFFA3;color:#555;}.ui-tooltip-default .ui-tooltip-titlebar{background-color:#FFEF93;}.ui-tooltip-default .ui-tooltip-icon{border-color:#CCC;background:#F1F1F1;color:#777;}.ui-tooltip-default .ui-tooltip-titlebar .ui-state-hover{border-color:#AAA;color:#111;}.ui-tooltip .ui-tooltip-tip{margin:0 auto;overflow:hidden;z-index:10;}.ui-tooltip .ui-tooltip-tip,.ui-tooltip .ui-tooltip-tip *{position:absolute;line-height:.1px!important;font-size:.1px!important;color:#123456;background:transparent;border:0 dashed transparent;}.ui-tooltip .ui-tooltip-tip canvas{top:0;left:0;}#qtip-overlay{position:fixed;left:-10000em;top:-10000em;}#qtip-overlay.blurs{cursor:pointer;}#qtip-overlay div{position:absolute;left:0;top:0;width:100%;height:100%;background-color:black;opacity:.7;filter:alpha(opacity=70);-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";}/*!Light tooltip style */ .ui-tooltip-light .ui-tooltip-titlebar,.ui-tooltip-light .ui-tooltip-content{border-color:#E2E2E2;color:#454545;}.ui-tooltip-light .ui-tooltip-content{background-color:white;}.ui-tooltip-light .ui-tooltip-titlebar{background-color:#f1f1f1;}/*!Dark tooltip style */ .ui-tooltip-dark .ui-tooltip-titlebar,.ui-tooltip-dark .ui-tooltip-content{border-color:#303030;color:#f3f3f3;}.ui-tooltip-dark .ui-tooltip-content{background-color:#505050;}.ui-tooltip-dark .ui-tooltip-titlebar{background-color:#404040;}.ui-tooltip-dark .ui-tooltip-icon{border-color:#444;}.ui-tooltip-dark .ui-tooltip-titlebar .ui-state-hover{border-color:#303030;}/*!Cream tooltip style */ .ui-tooltip-cream .ui-tooltip-titlebar,.ui-tooltip-cream .ui-tooltip-content{border-color:#F9E98E;color:#A27D35;}.ui-tooltip-cream .ui-tooltip-content{background-color:#FBF7AA;}.ui-tooltip-cream .ui-tooltip-titlebar{background-color:#F0DE7D;}.ui-tooltip-cream .ui-state-default .ui-tooltip-icon{background-position:-82px 0;}/*!Red tooltip style */ .ui-tooltip-red .ui-tooltip-titlebar,.ui-tooltip-red .ui-tooltip-content{border-color:#D95252;color:#912323;}.ui-tooltip-red .ui-tooltip-content{background-color:#F78B83;}.ui-tooltip-red .ui-tooltip-titlebar{background-color:#F06D65;}.ui-tooltip-red .ui-state-default .ui-tooltip-icon{background-position:-102px 0;}.ui-tooltip-red .ui-tooltip-icon{border-color:#D95252;}.ui-tooltip-red .ui-tooltip-titlebar .ui-state-hover{border-color:#D95252;}/*!Green tooltip style */ .ui-tooltip-green .ui-tooltip-titlebar,.ui-tooltip-green .ui-tooltip-content{border-color:#90D93F;color:#3F6219;}.ui-tooltip-green .ui-tooltip-content{background-color:#CAED9E;}.ui-tooltip-green .ui-tooltip-titlebar{background-color:#B0DE78;}.ui-tooltip-green .ui-state-default .ui-tooltip-icon{background-position:-42px 0;}/*!Blue tooltip style */ .ui-tooltip-blue .ui-tooltip-titlebar,.ui-tooltip-blue .ui-tooltip-content{border-color:#ADD9ED;color:#5E99BD;}.ui-tooltip-blue .ui-tooltip-content{background-color:#E5F6FE;}.ui-tooltip-blue .ui-tooltip-titlebar{background-color:#D0E9F5;}.ui-tooltip-blue .ui-state-default .ui-tooltip-icon{background-position:-2px 0;}/*!Add shadows to your tooltips in:FF3+,Chrome 2+,Opera 10.6+,IE6+,Safari 2+*/ .ui-tooltip-shadow{-webkit-box-shadow:1px 1px 3px 1px rgba(0,0,0,0.15);-moz-box-shadow:1px 1px 3px 1px rgba(0,0,0,0.15);box-shadow:1px 1px 3px 1px rgba(0,0,0,0.15);}.ui-tooltip-shadow .ui-tooltip-titlebar,.ui-tooltip-shadow .ui-tooltip-content{filter:progid:DXImageTransform.Microsoft.Shadow(Color='gray',Direction=135,Strength=3);-ms-filter:"progid:DXImageTransform.Microsoft.Shadow(Color='gray',Direction=135,Strength=3)";_margin-bottom:-3px;.margin-bottom:-3px;}/*!Add rounded corners to your tooltips in:FF3+,Chrome 2+,Opera 10.6+,IE9+,Safari 2+*/ .ui-tooltip-rounded,.ui-tooltip-rounded .ui-tooltip-content,.ui-tooltip-tipsy,.ui-tooltip-tipsy .ui-tooltip-content,.ui-tooltip-youtube,.ui-tooltip-youtube .ui-tooltip-content{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.ui-tooltip-rounded .ui-tooltip-titlebar,.ui-tooltip-tipsy .ui-tooltip-titlebar,.ui-tooltip-youtube .ui-tooltip-titlebar{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0;}.ui-tooltip-rounded .ui-tooltip-titlebar+.ui-tooltip-content,.ui-tooltip-tipsy .ui-tooltip-titlebar+.ui-tooltip-content,.ui-tooltip-youtube .ui-tooltip-titlebar+.ui-tooltip-content{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0 0 5px 5px;border-radius:0 0 5px 5px;}/*!Youtube tooltip style */ .ui-tooltip-youtube{-webkit-box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;box-shadow:0 0 3px #333;}.ui-tooltip-youtube .ui-tooltip-titlebar,.ui-tooltip-youtube .ui-tooltip-content{_margin-bottom:0;.margin-bottom:0;background:transparent;background:rgba(0,0,0,0.85);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000)";color:white;border-color:#CCC;}.ui-tooltip-youtube .ui-tooltip-icon{border-color:#222;}.ui-tooltip-youtube .ui-tooltip-titlebar .ui-state-hover{border-color:#303030;}.ui-tooltip-jtools{background:#232323;background:rgba(0,0,0,0.7);background-image:-moz-linear-gradient(top,#717171,#232323);background-image:-webkit-gradient(linear,left top,left bottom,from(#717171),to(#232323));border:2px solid #ddd;border:2px solid rgba(241,241,241,1);-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;-webkit-box-shadow:0 0 12px #333;-moz-box-shadow:0 0 12px #333;box-shadow:0 0 12px #333;}.ui-tooltip-jtools .ui-tooltip-titlebar{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#717171,endColorstr=#4A4A4A)";}.ui-tooltip-jtools .ui-tooltip-content{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#4A4A4A,endColorstr=#232323)";}.ui-tooltip-jtools .ui-tooltip-titlebar,.ui-tooltip-jtools .ui-tooltip-content{background:transparent;color:white;border:0 dashed transparent;}.ui-tooltip-jtools .ui-tooltip-icon{border-color:#555;}.ui-tooltip-jtools .ui-tooltip-titlebar .ui-state-hover{border-color:#333;}.ui-tooltip-cluetip{-webkit-box-shadow:4px 4px 5px rgba(0,0,0,0.4);-moz-box-shadow:4px 4px 5px rgba(0,0,0,0.4);box-shadow:4px 4px 5px rgba(0,0,0,0.4);}.ui-tooltip-cluetip .ui-tooltip-titlebar{background-color:#87876A;color:white;border:0 dashed transparent;}.ui-tooltip-cluetip .ui-tooltip-content{background-color:#D9D9C2;color:#111;border:0 dashed transparent;}.ui-tooltip-cluetip .ui-tooltip-icon{border-color:#808064;}.ui-tooltip-cluetip .ui-tooltip-titlebar .ui-state-hover{border-color:#696952;color:#696952;}.ui-tooltip-tipsy{border:0;}.ui-tooltip-tipsy .ui-tooltip-titlebar,.ui-tooltip-tipsy .ui-tooltip-content{_margin-bottom:0;.margin-bottom:0;background:transparent;background:rgba(0,0,0,.87);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#D9000000,endColorstr=#D9000000)";color:white;border:0 transparent;font-size:11px;font-family:'Lucida Grande',sans-serif;font-weight:bold;line-height:16px;text-shadow:0 1px black;}.ui-tooltip-tipsy .ui-tooltip-titlebar{padding:6px 35px 0 10;}.ui-tooltip-tipsy .ui-tooltip-content{padding:6px 10;}.ui-tooltip-tipsy .ui-tooltip-icon{border-color:#222;text-shadow:none;}.ui-tooltip-tipsy .ui-tooltip-titlebar .ui-state-hover{border-color:#303030;}.ui-tooltip-tipped .ui-tooltip-titlebar,.ui-tooltip-tipped .ui-tooltip-content{border:3px solid #959FA9;filter:none;-ms-filter:none;}.ui-tooltip-tipped .ui-tooltip-titlebar{background:#3A79B8;background-image:-moz-linear-gradient(top,#3A79B8,#2E629D);background-image:-webkit-gradient(linear,left top,left bottom,from(#3A79B8),to(#2E629D));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D);-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#3A79B8,endColorstr=#2E629D)";color:white;font-weight:normal;font-family:serif;border-bottom-width:0;-moz-border-radius:3px 3px 0 0;-webkit-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;}.ui-tooltip-tipped .ui-tooltip-content{background-color:#F9F9F9;color:#454545;-moz-border-radius:0 0 3px 3px;-webkit-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;}.ui-tooltip-tipped .ui-tooltip-icon{border:2px solid #285589;background:#285589;}.ui-tooltip-tipped .ui-tooltip-icon .ui-icon{background-color:#FBFBFB;color:#555;}.ui-tooltip:not(.ie9haxors) div.ui-tooltip-content,.ui-tooltip:not(.ie9haxors) div.ui-tooltip-titlebar{filter:none;-ms-filter:none;} \ No newline at end of file diff --git a/css/smoothness/jquery-ui-1.8.11.custom.css b/css/smoothness/jquery-ui-1.8.11.custom.css index 4c57c5b..69b0a33 100644 --- a/css/smoothness/jquery-ui-1.8.11.custom.css +++ b/css/smoothness/jquery-ui-1.8.11.custom.css @@ -59,20 +59,25 @@ #ZotpressMetaBox .ui-widget { } #ZotpressMetaBox .ui-widget .ui-widget { font-size: 1em; } /*#ZotpressMetaBox .ui-widget input, #ZotpressMetaBox .ui-widget select, #ZotpressMetaBox .ui-widget textarea, #ZotpressMetaBox .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }*/ -#ZotpressMetaBox .ui-widget-content { border: none; background: transparent; color: #222222; } +#ZotpressMetaBox .ui-widget-content { border: none; background: transparent; color: #555d66; } #ZotpressMetaBox .ui-widget-content a { color: #222222; } -#ZotpressMetaBox .ui-widget-header { border: 0; background: #F5F5F5; color: #222222; font-weight: normal; font-size: 0.85em !important; text-transform: uppercase; } +#ZotpressMetaBox .ui-widget-header { + /* border: 0; background: #fff; color: #222222; font-weight: normal; */ + font-size: 0.85em !important; text-transform: uppercase; +} #ZotpressMetaBox .ui-widget-header a { color: #222222; } /* Interaction states ----------------------------------*/ -#ZotpressMetaBox .ui-state-default, #ZotpressMetaBox .ui-widget-content .ui-state-default, #ZotpressMetaBox .ui-widget-header .ui-state-default { border: none; background: #e6e6e6; color: #666; float: left; margin: 0.35em 0 0 0.35em; } +/* #ZotpressMetaBox .ui-state-default, #ZotpressMetaBox .ui-widget-content .ui-state-default, #ZotpressMetaBox .ui-widget-header .ui-state-default { border: none; background: #fff; color: #222; float: left; margin: 0; padding: 8px 4px; } */ +/* #ZotpressMetaBox .ui-state-default:before, #ZotpressMetaBox .ui-widget-content .ui-state-default:before, #ZotpressMetaBox .ui-widget-header .ui-state-default:before { content: " "; display: block; background: url('images/ui-icons_222222_256x240.png') -111px 335px; width: 20px; height: 14px; float: left; } */ #ZotpressMetaBox .ui-state-default a, #ZotpressMetaBox .ui-state-default a:link, #ZotpressMetaBox .ui-state-default a:visited { color: #555555; text-decoration: none; } -#ZotpressMetaBox .ui-state-hover, #ZotpressMetaBox .ui-widget-content .ui-state-hover, #ZotpressMetaBox .ui-widget-header .ui-state-hover, #ZotpressMetaBox .ui-state-focus, #ZotpressMetaBox .ui-widget-content .ui-state-focus, #ZotpressMetaBox .ui-widget-header .ui-state-focus { background: #ccc; color: #000; } +#ZotpressMetaBox .ui-state-hover, #ZotpressMetaBox .ui-widget-content .ui-state-hover, #ZotpressMetaBox .ui-widget-header .ui-state-hover, #ZotpressMetaBox .ui-state-focus, #ZotpressMetaBox .ui-widget-content .ui-state-focus, #ZotpressMetaBox .ui-widget-header .ui-state-focus { } #ZotpressMetaBox .ui-state-hover a, #ZotpressMetaBox .ui-state-hover a:hover { color: #212121; text-decoration: none; } -#ZotpressMetaBox .ui-state-active, #ZotpressMetaBox .ui-widget-content .ui-state-active, #ZotpressMetaBox .ui-widget-header .ui-state-active { border: none; background: #ffffff; color: #222; } -#ZotpressMetaBox .ui-state-active a, #ZotpressMetaBox .ui-state-active a:link, #ZotpressMetaBox .ui-state-active a:visited { color: #212121; text-decoration: none; } -#ZotpressMetaBox .ui-widget :active { outline: none; } +/* #ZotpressMetaBox .ui-state-active, #ZotpressMetaBox .ui-widget-content .ui-state-active, #ZotpressMetaBox .ui-widget-header .ui-state-active { border: none; background: #ffffff; color: #222; } */ +/* #ZotpressMetaBox .ui-state-active:before, #ZotpressMetaBox .ui-widget-content .ui-state-active:before, #ZotpressMetaBox .ui-widget-header .ui-state-active:before { content: " "; display: block; background: url('images/ui-icons_222222_256x240.png') -206px 287px; width: 20px; height: 14px; float: left; } */ +#ZotpressMetaBox .ui-state-active a, #ZotpressMetaBox .ui-state-active a:link, #ZotpressMetaBox .ui-state-active a:visited, #ZotpressMetaBox .ui-state-active a:focus { color: #212121; text-decoration: none; } +#ZotpressMetaBox .ui-widget :active, #ZotpressMetaBox .ui-widget :focus { outline: none; box-shadow: none; } /* Interaction Cues ----------------------------------*/ @@ -304,7 +309,7 @@ #ZotpressMetaBox .ui-tabs { position: relative; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ #ZotpressMetaBox .ui-tabs #ZotpressMetaBox .ui-tabs-nav { margin: 0; padding: 0 0 0 1px; } #ZotpressMetaBox .ui-tabs #ZotpressMetaBox .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 1px 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } -#ZotpressMetaBox .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +/* #ZotpressMetaBox .ui-tabs .ui-tabs-nav li a { float: left; padding: 0; text-decoration: none; } */ #ZotpressMetaBox .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } #ZotpressMetaBox .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, #ZotpressMetaBox .ui-tabs .ui-tabs-nav li.ui-state-disabled a, #ZotpressMetaBox .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } #ZotpressMetaBox .ui-tabs .ui-tabs-nav li a, #ZotpressMetaBox .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ @@ -331,7 +336,7 @@ #ZotpressMetaBox .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } #ZotpressMetaBox .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } #ZotpressMetaBox .ui-datepicker select.ui-datepicker-month-year {width: 100%;} -#ZotpressMetaBox .ui-datepicker select.ui-datepicker-month, +#ZotpressMetaBox .ui-datepicker select.ui-datepicker-month, #ZotpressMetaBox .ui-datepicker select.ui-datepicker-year { width: 49%;} #ZotpressMetaBox .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } #ZotpressMetaBox .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } @@ -377,4 +382,4 @@ left: -4px; /*must have*/ width: 200px; /*must have*/ height: 200px; /*must have*/ -} \ No newline at end of file +} diff --git a/css/smoothness/jquery-ui-1.8.11.custom.min.css b/css/smoothness/jquery-ui-1.8.11.custom.min.css new file mode 100644 index 0000000..9e2c25f --- /dev/null +++ b/css/smoothness/jquery-ui-1.8.11.custom.min.css @@ -0,0 +1 @@ +#ZotpressMetaBox .ui-helper-hidden{display:none}#ZotpressMetaBox .ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}#ZotpressMetaBox .ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}#ZotpressMetaBox .ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}#ZotpressMetaBox .ui-helper-clearfix{display:inline-block}* html #ZotpressMetaBox .ui-helper-clearfix{height:1%}#ZotpressMetaBox .ui-helper-clearfix{display:block}#ZotpressMetaBox .ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}#ZotpressMetaBox .ui-state-disabled{cursor:default!important}#ZotpressMetaBox .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}#ZotpressMetaBox .ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}#ZotpressMetaBox .ui-widget .ui-widget{font-size:1em}#ZotpressMetaBox .ui-widget-content{border:none;background:0 0;color:#555d66}#ZotpressMetaBox .ui-widget-content a{color:#222}#ZotpressMetaBox .ui-widget-header{font-size:.85em!important;text-transform:uppercase}#ZotpressMetaBox .ui-widget-header a{color:#222}#ZotpressMetaBox .ui-state-default a,#ZotpressMetaBox .ui-state-default a:link,#ZotpressMetaBox .ui-state-default a:visited{color:#555;text-decoration:none}#ZotpressMetaBox .ui-state-hover a,#ZotpressMetaBox .ui-state-hover a:hover{color:#212121;text-decoration:none}#ZotpressMetaBox .ui-state-active a,#ZotpressMetaBox .ui-state-active a:focus,#ZotpressMetaBox .ui-state-active a:link,#ZotpressMetaBox .ui-state-active a:visited{color:#212121;text-decoration:none}#ZotpressMetaBox .ui-widget :active,#ZotpressMetaBox .ui-widget :focus{outline:0;box-shadow:none}#ZotpressMetaBox .ui-state-highlight,#ZotpressMetaBox .ui-widget-content .ui-state-highlight,#ZotpressMetaBox .ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}#ZotpressMetaBox .ui-state-highlight a,#ZotpressMetaBox .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}#ZotpressMetaBox .ui-state-error,#ZotpressMetaBox .ui-widget-content .ui-state-error,#ZotpressMetaBox .ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}#ZotpressMetaBox .ui-state-error a,#ZotpressMetaBox .ui-widget-content .ui-state-error a,#ZotpressMetaBox .ui-widget-header .ui-state-error a{color:#cd0a0a}#ZotpressMetaBox .ui-state-error-text,#ZotpressMetaBox .ui-widget-content .ui-state-error-text,#ZotpressMetaBox .ui-widget-header .ui-state-error-text{color:#cd0a0a}#ZotpressMetaBox .ui-priority-primary,#ZotpressMetaBox .ui-widget-content .ui-priority-primary,#ZotpressMetaBox .ui-widget-header .ui-priority-primary{font-weight:700}#ZotpressMetaBox .ui-priority-secondary,#ZotpressMetaBox .ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}#ZotpressMetaBox .ui-state-disabled,#ZotpressMetaBox .ui-widget-content .ui-state-disabled,#ZotpressMetaBox .ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}#ZotpressMetaBox .ui-icon{width:16px;height:16px;background-image:url(images/ui-icons_222222_256x240.png)}#ZotpressMetaBox .ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}#ZotpressMetaBox .ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}#ZotpressMetaBox .ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}#ZotpressMetaBox .ui-state-focus .ui-icon,#ZotpressMetaBox .ui-state-hover .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}#ZotpressMetaBox .ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}#ZotpressMetaBox .ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}#ZotpressMetaBox .ui-state-error .ui-icon,#ZotpressMetaBox .ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}#ZotpressMetaBox .ui-icon-carat-1-n{background-position:0 0}#ZotpressMetaBox .ui-icon-carat-1-ne{background-position:-16px 0}#ZotpressMetaBox .ui-icon-carat-1-e{background-position:-32px 0}#ZotpressMetaBox .ui-icon-carat-1-se{background-position:-48px 0}#ZotpressMetaBox .ui-icon-carat-1-s{background-position:-64px 0}#ZotpressMetaBox .ui-icon-carat-1-sw{background-position:-80px 0}#ZotpressMetaBox .ui-icon-carat-1-w{background-position:-96px 0}#ZotpressMetaBox .ui-icon-carat-1-nw{background-position:-112px 0}#ZotpressMetaBox .ui-icon-carat-2-n-s{background-position:-128px 0}#ZotpressMetaBox .ui-icon-carat-2-e-w{background-position:-144px 0}#ZotpressMetaBox .ui-icon-triangle-1-n{background-position:0 -16px}#ZotpressMetaBox .ui-icon-triangle-1-ne{background-position:-16px -16px}#ZotpressMetaBox .ui-icon-triangle-1-e{background-position:-32px -16px}#ZotpressMetaBox .ui-icon-triangle-1-se{background-position:-48px -16px}#ZotpressMetaBox .ui-icon-triangle-1-s{background-position:-64px -16px}#ZotpressMetaBox .ui-icon-triangle-1-sw{background-position:-80px -16px}#ZotpressMetaBox .ui-icon-triangle-1-w{background-position:-96px -16px}#ZotpressMetaBox .ui-icon-triangle-1-nw{background-position:-112px -16px}#ZotpressMetaBox .ui-icon-triangle-2-n-s{background-position:-128px -16px}#ZotpressMetaBox .ui-icon-triangle-2-e-w{background-position:-144px -16px}#ZotpressMetaBox .ui-icon-arrow-1-n{background-position:0 -32px}#ZotpressMetaBox .ui-icon-arrow-1-ne{background-position:-16px -32px}#ZotpressMetaBox .ui-icon-arrow-1-e{background-position:-32px -32px}#ZotpressMetaBox .ui-icon-arrow-1-se{background-position:-48px -32px}#ZotpressMetaBox .ui-icon-arrow-1-s{background-position:-64px -32px}#ZotpressMetaBox .ui-icon-arrow-1-sw{background-position:-80px -32px}#ZotpressMetaBox .ui-icon-arrow-1-w{background-position:-96px -32px}#ZotpressMetaBox .ui-icon-arrow-1-nw{background-position:-112px -32px}#ZotpressMetaBox .ui-icon-arrow-2-n-s{background-position:-128px -32px}#ZotpressMetaBox .ui-icon-arrow-2-ne-sw{background-position:-144px -32px}#ZotpressMetaBox .ui-icon-arrow-2-e-w{background-position:-160px -32px}#ZotpressMetaBox .ui-icon-arrow-2-se-nw{background-position:-176px -32px}#ZotpressMetaBox .ui-icon-arrowstop-1-n{background-position:-192px -32px}#ZotpressMetaBox .ui-icon-arrowstop-1-e{background-position:-208px -32px}#ZotpressMetaBox .ui-icon-arrowstop-1-s{background-position:-224px -32px}#ZotpressMetaBox .ui-icon-arrowstop-1-w{background-position:-240px -32px}#ZotpressMetaBox .ui-icon-arrowthick-1-n{background-position:0 -48px}#ZotpressMetaBox .ui-icon-arrowthick-1-ne{background-position:-16px -48px}#ZotpressMetaBox .ui-icon-arrowthick-1-e{background-position:-32px -48px}#ZotpressMetaBox .ui-icon-arrowthick-1-se{background-position:-48px -48px}#ZotpressMetaBox .ui-icon-arrowthick-1-s{background-position:-64px -48px}#ZotpressMetaBox .ui-icon-arrowthick-1-sw{background-position:-80px -48px}#ZotpressMetaBox .ui-icon-arrowthick-1-w{background-position:-96px -48px}#ZotpressMetaBox .ui-icon-arrowthick-1-nw{background-position:-112px -48px}#ZotpressMetaBox .ui-icon-arrowthick-2-n-s{background-position:-128px -48px}#ZotpressMetaBox .ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}#ZotpressMetaBox .ui-icon-arrowthick-2-e-w{background-position:-160px -48px}#ZotpressMetaBox .ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}#ZotpressMetaBox .ui-icon-arrowthickstop-1-n{background-position:-192px -48px}#ZotpressMetaBox .ui-icon-arrowthickstop-1-e{background-position:-208px -48px}#ZotpressMetaBox .ui-icon-arrowthickstop-1-s{background-position:-224px -48px}#ZotpressMetaBox .ui-icon-arrowthickstop-1-w{background-position:-240px -48px}#ZotpressMetaBox .ui-icon-arrowreturnthick-1-w{background-position:0 -64px}#ZotpressMetaBox .ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}#ZotpressMetaBox .ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}#ZotpressMetaBox .ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}#ZotpressMetaBox .ui-icon-arrowreturn-1-w{background-position:-64px -64px}#ZotpressMetaBox .ui-icon-arrowreturn-1-n{background-position:-80px -64px}#ZotpressMetaBox .ui-icon-arrowreturn-1-e{background-position:-96px -64px}#ZotpressMetaBox .ui-icon-arrowreturn-1-s{background-position:-112px -64px}#ZotpressMetaBox .ui-icon-arrowrefresh-1-w{background-position:-128px -64px}#ZotpressMetaBox .ui-icon-arrowrefresh-1-n{background-position:-144px -64px}#ZotpressMetaBox .ui-icon-arrowrefresh-1-e{background-position:-160px -64px}#ZotpressMetaBox .ui-icon-arrowrefresh-1-s{background-position:-176px -64px}#ZotpressMetaBox .ui-icon-arrow-4{background-position:0 -80px}#ZotpressMetaBox .ui-icon-arrow-4-diag{background-position:-16px -80px}#ZotpressMetaBox .ui-icon-extlink{background-position:-32px -80px}#ZotpressMetaBox .ui-icon-newwin{background-position:-48px -80px}#ZotpressMetaBox .ui-icon-refresh{background-position:-64px -80px}#ZotpressMetaBox .ui-icon-shuffle{background-position:-80px -80px}#ZotpressMetaBox .ui-icon-transfer-e-w{background-position:-96px -80px}#ZotpressMetaBox .ui-icon-transferthick-e-w{background-position:-112px -80px}#ZotpressMetaBox .ui-icon-folder-collapsed{background-position:0 -96px}#ZotpressMetaBox .ui-icon-folder-open{background-position:-16px -96px}#ZotpressMetaBox .ui-icon-document{background-position:-32px -96px}#ZotpressMetaBox .ui-icon-document-b{background-position:-48px -96px}#ZotpressMetaBox .ui-icon-note{background-position:-64px -96px}#ZotpressMetaBox .ui-icon-mail-closed{background-position:-80px -96px}#ZotpressMetaBox .ui-icon-mail-open{background-position:-96px -96px}#ZotpressMetaBox .ui-icon-suitcase{background-position:-112px -96px}#ZotpressMetaBox .ui-icon-comment{background-position:-128px -96px}#ZotpressMetaBox .ui-icon-person{background-position:-144px -96px}#ZotpressMetaBox .ui-icon-print{background-position:-160px -96px}#ZotpressMetaBox .ui-icon-trash{background-position:-176px -96px}#ZotpressMetaBox .ui-icon-locked{background-position:-192px -96px}#ZotpressMetaBox .ui-icon-unlocked{background-position:-208px -96px}#ZotpressMetaBox .ui-icon-bookmark{background-position:-224px -96px}#ZotpressMetaBox .ui-icon-tag{background-position:-240px -96px}#ZotpressMetaBox .ui-icon-home{background-position:0 -112px}#ZotpressMetaBox .ui-icon-flag{background-position:-16px -112px}#ZotpressMetaBox .ui-icon-calendar{background-position:-32px -112px}#ZotpressMetaBox .ui-icon-cart{background-position:-48px -112px}#ZotpressMetaBox .ui-icon-pencil{background-position:-64px -112px}#ZotpressMetaBox .ui-icon-clock{background-position:-80px -112px}#ZotpressMetaBox .ui-icon-disk{background-position:-96px -112px}#ZotpressMetaBox .ui-icon-calculator{background-position:-112px -112px}#ZotpressMetaBox .ui-icon-zoomin{background-position:-128px -112px}#ZotpressMetaBox .ui-icon-zoomout{background-position:-144px -112px}#ZotpressMetaBox .ui-icon-search{background-position:-160px -112px}#ZotpressMetaBox .ui-icon-wrench{background-position:-176px -112px}#ZotpressMetaBox .ui-icon-gear{background-position:-192px -112px}#ZotpressMetaBox .ui-icon-heart{background-position:-208px -112px}#ZotpressMetaBox .ui-icon-star{background-position:-224px -112px}#ZotpressMetaBox .ui-icon-link{background-position:-240px -112px}#ZotpressMetaBox .ui-icon-cancel{background-position:0 -128px}#ZotpressMetaBox .ui-icon-plus{background-position:-16px -128px}#ZotpressMetaBox .ui-icon-plusthick{background-position:-32px -128px}#ZotpressMetaBox .ui-icon-minus{background-position:-48px -128px}#ZotpressMetaBox .ui-icon-minusthick{background-position:-64px -128px}#ZotpressMetaBox .ui-icon-close{background-position:-80px -128px}#ZotpressMetaBox .ui-icon-closethick{background-position:-96px -128px}#ZotpressMetaBox .ui-icon-key{background-position:-112px -128px}#ZotpressMetaBox .ui-icon-lightbulb{background-position:-128px -128px}#ZotpressMetaBox .ui-icon-scissors{background-position:-144px -128px}#ZotpressMetaBox .ui-icon-clipboard{background-position:-160px -128px}#ZotpressMetaBox .ui-icon-copy{background-position:-176px -128px}#ZotpressMetaBox .ui-icon-contact{background-position:-192px -128px}#ZotpressMetaBox .ui-icon-image{background-position:-208px -128px}#ZotpressMetaBox .ui-icon-video{background-position:-224px -128px}#ZotpressMetaBox .ui-icon-script{background-position:-240px -128px}#ZotpressMetaBox .ui-icon-alert{background-position:0 -144px}#ZotpressMetaBox .ui-icon-info{background-position:-16px -144px}#ZotpressMetaBox .ui-icon-notice{background-position:-32px -144px}#ZotpressMetaBox .ui-icon-help{background-position:-48px -144px}#ZotpressMetaBox .ui-icon-check{background-position:-64px -144px}#ZotpressMetaBox .ui-icon-bullet{background-position:-80px -144px}#ZotpressMetaBox .ui-icon-radio-off{background-position:-96px -144px}#ZotpressMetaBox .ui-icon-radio-on{background-position:-112px -144px}#ZotpressMetaBox .ui-icon-pin-w{background-position:-128px -144px}#ZotpressMetaBox .ui-icon-pin-s{background-position:-144px -144px}#ZotpressMetaBox .ui-icon-play{background-position:0 -160px}#ZotpressMetaBox .ui-icon-pause{background-position:-16px -160px}#ZotpressMetaBox .ui-icon-seek-next{background-position:-32px -160px}#ZotpressMetaBox .ui-icon-seek-prev{background-position:-48px -160px}#ZotpressMetaBox .ui-icon-seek-end{background-position:-64px -160px}#ZotpressMetaBox .ui-icon-seek-start{background-position:-80px -160px}#ZotpressMetaBox .ui-icon-seek-first{background-position:-80px -160px}#ZotpressMetaBox .ui-icon-stop{background-position:-96px -160px}#ZotpressMetaBox .ui-icon-eject{background-position:-112px -160px}#ZotpressMetaBox .ui-icon-volume-off{background-position:-128px -160px}#ZotpressMetaBox .ui-icon-volume-on{background-position:-144px -160px}#ZotpressMetaBox .ui-icon-power{background-position:0 -176px}#ZotpressMetaBox .ui-icon-signal-diag{background-position:-16px -176px}#ZotpressMetaBox .ui-icon-signal{background-position:-32px -176px}#ZotpressMetaBox .ui-icon-battery-0{background-position:-48px -176px}#ZotpressMetaBox .ui-icon-battery-1{background-position:-64px -176px}#ZotpressMetaBox .ui-icon-battery-2{background-position:-80px -176px}#ZotpressMetaBox .ui-icon-battery-3{background-position:-96px -176px}#ZotpressMetaBox .ui-icon-circle-plus{background-position:0 -192px}#ZotpressMetaBox .ui-icon-circle-minus{background-position:-16px -192px}#ZotpressMetaBox .ui-icon-circle-close{background-position:-32px -192px}#ZotpressMetaBox .ui-icon-circle-triangle-e{background-position:-48px -192px}#ZotpressMetaBox .ui-icon-circle-triangle-s{background-position:-64px -192px}#ZotpressMetaBox .ui-icon-circle-triangle-w{background-position:-80px -192px}#ZotpressMetaBox .ui-icon-circle-triangle-n{background-position:-96px -192px}#ZotpressMetaBox .ui-icon-circle-arrow-e{background-position:-112px -192px}#ZotpressMetaBox .ui-icon-circle-arrow-s{background-position:-128px -192px}#ZotpressMetaBox .ui-icon-circle-arrow-w{background-position:-144px -192px}#ZotpressMetaBox .ui-icon-circle-arrow-n{background-position:-160px -192px}#ZotpressMetaBox .ui-icon-circle-zoomin{background-position:-176px -192px}#ZotpressMetaBox .ui-icon-circle-zoomout{background-position:-192px -192px}#ZotpressMetaBox .ui-icon-circle-check{background-position:-208px -192px}#ZotpressMetaBox .ui-icon-circlesmall-plus{background-position:0 -208px}#ZotpressMetaBox .ui-icon-circlesmall-minus{background-position:-16px -208px}#ZotpressMetaBox .ui-icon-circlesmall-close{background-position:-32px -208px}#ZotpressMetaBox .ui-icon-squaresmall-plus{background-position:-48px -208px}#ZotpressMetaBox .ui-icon-squaresmall-minus{background-position:-64px -208px}#ZotpressMetaBox .ui-icon-squaresmall-close{background-position:-80px -208px}#ZotpressMetaBox .ui-icon-grip-dotted-vertical{background-position:0 -224px}#ZotpressMetaBox .ui-icon-grip-dotted-horizontal{background-position:-16px -224px}#ZotpressMetaBox .ui-icon-grip-solid-vertical{background-position:-32px -224px}#ZotpressMetaBox .ui-icon-grip-solid-horizontal{background-position:-48px -224px}#ZotpressMetaBox .ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}#ZotpressMetaBox .ui-icon-grip-diagonal-se{background-position:-80px -224px}#ZotpressMetaBox .ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px}#ZotpressMetaBox .ui-corner-tr{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px}#ZotpressMetaBox .ui-corner-bl{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px}#ZotpressMetaBox .ui-corner-br{-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px}#ZotpressMetaBox .ui-corner-bottom{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px}#ZotpressMetaBox .ui-corner-right{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px}#ZotpressMetaBox .ui-corner-left{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px}#ZotpressMetaBox .ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}#ZotpressMetaBox .ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}#ZotpressMetaBox .ui-tabs{position:relative;zoom:1}#ZotpressMetaBox .ui-tabs #ZotpressMetaBox .ui-tabs-nav{margin:0;padding:0 0 0 1px}#ZotpressMetaBox .ui-tabs #ZotpressMetaBox .ui-tabs-nav li{list-style:none;float:left;position:relative;top:1px;margin:0 1px 1px 0;border-bottom:0!important;padding:0;white-space:nowrap}#ZotpressMetaBox .ui-tabs .ui-tabs-nav li.ui-tabs-selected{margin-bottom:0;padding-bottom:1px}#ZotpressMetaBox .ui-tabs .ui-tabs-nav li.ui-state-disabled a,#ZotpressMetaBox .ui-tabs .ui-tabs-nav li.ui-state-processing a,#ZotpressMetaBox .ui-tabs .ui-tabs-nav li.ui-tabs-selected a{cursor:text}#ZotpressMetaBox .ui-tabs .ui-tabs-nav li a,#ZotpressMetaBox .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a{cursor:pointer}#ZotpressMetaBox .ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:0;background:0 0}#ZotpressMetaBox .ui-tabs .ui-tabs-hide{display:none!important}#ZotpressMetaBox .ui-datepicker{width:17em;padding:.2em .2em 0;display:none}#ZotpressMetaBox .ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}#ZotpressMetaBox .ui-datepicker .ui-datepicker-next,#ZotpressMetaBox .ui-datepicker .ui-datepicker-prev{position:absolute;top:2px;width:1.8em;height:1.8em}#ZotpressMetaBox .ui-datepicker .ui-datepicker-next-hover,#ZotpressMetaBox .ui-datepicker .ui-datepicker-prev-hover{top:1px}#ZotpressMetaBox .ui-datepicker .ui-datepicker-prev{left:2px}#ZotpressMetaBox .ui-datepicker .ui-datepicker-next{right:2px}#ZotpressMetaBox .ui-datepicker .ui-datepicker-prev-hover{left:1px}#ZotpressMetaBox .ui-datepicker .ui-datepicker-next-hover{right:1px}#ZotpressMetaBox .ui-datepicker .ui-datepicker-next span,#ZotpressMetaBox .ui-datepicker .ui-datepicker-prev span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}#ZotpressMetaBox .ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}#ZotpressMetaBox .ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}#ZotpressMetaBox .ui-datepicker select.ui-datepicker-month-year{width:100%}#ZotpressMetaBox .ui-datepicker select.ui-datepicker-month,#ZotpressMetaBox .ui-datepicker select.ui-datepicker-year{width:49%}#ZotpressMetaBox .ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}#ZotpressMetaBox .ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}#ZotpressMetaBox .ui-datepicker td{border:0;padding:1px}#ZotpressMetaBox .ui-datepicker td a,#ZotpressMetaBox .ui-datepicker td span{display:block;padding:.2em;text-align:right;text-decoration:none}#ZotpressMetaBox .ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}#ZotpressMetaBox .ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}#ZotpressMetaBox .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}#ZotpressMetaBox .ui-datepicker.ui-datepicker-multi{width:auto}#ZotpressMetaBox .ui-datepicker-multi .ui-datepicker-group{float:left}#ZotpressMetaBox .ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}#ZotpressMetaBox .ui-datepicker-multi-2 .ui-datepicker-group{width:50%}#ZotpressMetaBox .ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}#ZotpressMetaBox .ui-datepicker-multi-4 .ui-datepicker-group{width:25%}#ZotpressMetaBox .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0}#ZotpressMetaBox .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}#ZotpressMetaBox .ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}#ZotpressMetaBox .ui-datepicker-row-break{clear:both;width:100%}#ZotpressMetaBox .ui-datepicker-rtl{direction:rtl}#ZotpressMetaBox .ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}#ZotpressMetaBox .ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}#ZotpressMetaBox .ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}#ZotpressMetaBox .ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}#ZotpressMetaBox .ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}#ZotpressMetaBox .ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}#ZotpressMetaBox .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:right}#ZotpressMetaBox .ui-datepicker-rtl .ui-datepicker-group{float:right}#ZotpressMetaBox .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0;border-left-width:1px}#ZotpressMetaBox .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}#ZotpressMetaBox .ui-datepicker-cover{display:none;display:block;position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px} diff --git a/css/zotpress.admin.css b/css/zotpress.admin.css new file mode 100644 index 0000000..21a9c64 --- /dev/null +++ b/css/zotpress.admin.css @@ -0,0 +1,1392 @@ + + +/* START OF BASIC ZOTPRESS CSS */ + +div#zp-Zotpress select { + cursor: pointer; +} + +div#zp-Zotpress div.zp-Col-1 { + float: left; + width: 350px; +} +div#zp-Zotpress div.zp-Col-2 { + float: left; +} + +#adminmenu .current .wp-menu-image img { + opacity: 1.0; + /* filter: alpha(opacity = 100); */ +} + +div#zp-Zotpress del { + color: #aaa; + text-decoration: none; +} + +div#zp-Setup h3, +div#zp-Zotpress h3 { + clear: both; + font: 400 27px/32px "Helvetica", "Helvetica Neue", "Arial", sans-serif; + margin: 0; + font-weight: bold; + padding: 9px 15px 4px 0; + text-transform: none; +} +div#zp-Setup h3.pair { + border-bottom: 0; + padding: 15px 30px 0; +} + +div.zp-Collection-Title, +div#zp-Setup h4, +div#zp-Zotpress h4 { + font: italic 400 17px/21px "Georgia", serif; + margin: 1.5em 0 1em; +} +div#zp-Setup h4 { + font: italic 400 16px/21px "Georgia", serif; +} +div#zp-Setup h4.pair { + border-bottom: 1px solid #eee; + margin: 0; + padding: 10px 30px 25px; +} + +div#zp-Zotpress h5 { + font: 300 11px/30px "Georgia", serif; + margin-bottom: -15px; + text-transform: uppercase; +} + +div#zp-Zotpress hr { + border: none; + border-top: 1px solid #ddd; + clear: both; + margin: 3.3em 0 0.7em; + height: 1px; +} +div#zp-Setup hr.clear, +div#zp-Zotpress hr.clear { + border: none; + margin-bottom: 0; +} + +div#zp-Setup ul, +div#zp-Zotpress ul { + list-style: none; + margin: 20px 0 25px; + padding: 0; +} +div#zp-Setup ul li, +div#zp-Zotpress ul li { + background: url('../images/sprite.png') no-repeat -40px -60px; + padding-left: 15px; + margin-left: 5px; + margin-bottom: 10px; + list-style: none; +} + +div#zp-Zotpress form hr.clear { + margin: 0; + padding: 0; + height: 1px; +} + +div#zp-Zotpress p.example { + font-family: monospace; + font-size: 1.1em; +} + +/* END OF BASIC ZOTPRESS CSS */ + + + +/* START OF SETUP CSS */ + +div#zp-Setup { + border-bottom: 1px solid #ccc; + margin-right: 1.5em; + width: auto; + min-width: 549px; +} +div#zp-Setup div#zp-Zotpress-Navigation { + z-index: 1; + position: relative; + margin-bottom: 0; +} +div.zp-Setup-Step, +div#zp-Setup-Step { + z-index: 0; + position: relative; + background-color: #fff; + padding: 1em 0 0.65em; +} +div.zp-Setup-Step.second { + border-top: 1px solid #eee; +} +div.zp-Setup-Step.second:before, +div.zp-Setup-Step.second:after { + display: table; + content: ""; +} +div.zp-Setup-Step.second:after { + clear: both; +} + +div#zp-Setup h3 { + padding: 15px 30px 25px; + border-bottom: 1px solid #eee; +} +div#zp-Setup-Step hr { + clear: both; + border: none; + padding: 0; + margin: 1em 0; + height: 1px; + background: none; + border-top: 1px solid #eee; +} +div#zp-Setup-Step hr.clear { + margin: 0; +} + +div#zp-Setup div.zp-Column-1, +div#zp-Setup div.zp-Column-2 { + float: left; + margin-left: 30px; + width: 400px; +} + +div#zp-Setup p.note { + color: #666; + font-size: 0.9em; + font-style: italic; + margin: -10px 0 10px 0; +} + +div#zp-Setup div.zp-Zotpress-Options { + margin-bottom: 2em; +} + +div#zp-Zotpress-Setup-Buttons { + clear: both; + border-top: 1px solid #eee; +} +a#zp-Setup-Cancel, +div#zp-Zotpress-Setup-Buttons a, +div#zp-Zotpress-Setup-Buttons input { + margin: 1em 30px 0.5em; + float: right; +} +a#zp-Setup-Cancel { + float: none; +} +div#zp-Zotpress-Setup-Buttons a#zp-Import-Accounts-Button { + margin-right: 0; +} +div#zp-Zotpress-Setup-Buttons a#zp-Import-Browse-Button { + margin-left: 10px; +} + +div#zp-Setup div.zp-Zotpress-Options div.zp-Success, +div#zp-Setup div.zp-Zotpress-Options div.zp-Loading, +div#zp-Setup div.zp-Zotpress-Options div.zp-Errors { + float: left; + height: 32px; +} +div#zp-Setup div.zp-Zotpress-Options div.zp-Success, +div#zp-Setup div.zp-Zotpress-Options div.zp-Errors { + margin-top: 14px; + margin-bottom: 0; + padding-left: 35px; + height: 24px; +} +div#zp-Setup div.zp-Zotpress-Options div.zp-Success { + background-position: 0 -82px; +} +div#zp-Setup div.zp-Zotpress-Options div.zp-Errors { + background-position: 0 -146px; +} +div#zp-Setup div.zp-Zotpress-Options div.zp-Loading { + margin-top: 6px; +} + + +div#zp-Setup div.zp-Column, +div#zp-Zotpress div.zp-Column { + border-bottom: 1px solid #eee; +} +div#zp-Setup div.zp-Column div.zp-Column-Inner { + padding: 0 25px; +} + + +div.zp-Step-Import, +div#zp-Step-Import { + padding: 10px 30px; +} +.second div.zp-Step-Import { + padding-top: 0; +} +div#zp-Zotpress-Setup-Import-Buttons { + margin-top: 2em; +} +input#zp-Zotpress-Setup-Import, +.wp-core-ui input.zp-Import-Button.button-secondary { + margin: 0 0.5em 1em 0; + float: left; +} +div#zp-Step-Import-Collection { + background-color: #f9f9f9; + clear: both; + margin-top: 1em; + width: 36.75em; + height: 13.5em; +} +div#zp-Step-Import-Collection.loading { + background: #f9f9f9 url('../images/loading_default.gif') no-repeat center; +} +div#zp-Step-Import-Collection iframe { + width: 100%; +} +#zp-Zotpress-Setup-Import-Selective { + float: left; + margin: 1em 0; +} + + +iframe#zp-Setup-Import { + position: absolute; + top: 0; + right: 0; + margin: 0; + padding: 0; + + /* LIVE */ + visibility: hidden; + width: 50px; + height: 35px; + + /* DEBUGGING */ + /*border: 3px solid #eee;*/ + /*width: 350px;*/ + /*height: 200px;*/ +} + +div.zp-Loading-Container { + clear: both; + padding-top: 0.75em; +} +div.zp-Loading-Container:before, +div.zp-Loading-Container:after { + content: ""; + display: table; +} +div.zp-Loading-Container:after { + clear: both; +} +div.zp-Loading-Container.selective { + clear: none; + padding-top: 0; +} +div.zp-Loading-Initial.zp-Loading-Import { + background: transparent url('../images/loading_import.gif') no-repeat 0 6px; + display: none; + float: left; + margin: 0; + width: 70px; + height: 20px; +} +div.zp-Loading-Initial.zp-Loading-Import.selective { + margin-top: 1.35em; + margin-left: 1em; +} +div.zp-Import-Messages { + color: #999; + font: italic 9px/20px Georgia,"Times New Roman","Bitstream Charter",Times,serif; + display: none; + float: left; + margin: 0 0 0 1em; +} +div.zp-Import-Messages.selective { + margin-top: 1.95em; +} + +div.Zotpress_update_notice .notice-dismiss.text { + position: static; + color: inherit; + text-decoration: underline; + padding: 0; +} +div.Zotpress_update_notice .notice-dismiss.text::before { + display: none; +} + + + +/* START OF SETUP CHECK */ + +#zp-Setup-Check { + padding: 1.5em 30px; +} +#zp-Setup-Check-Message.error { + background: #fceae9; +} +#zp-Setup-Check-Message.updated { + background: #eef9e6; +} +div#zp-Setup-Check-Message.error strong em { + color: #E14D43; + font-style: normal; +} +div#zp-Setup-Check-Message.updated strong em { + color: #7AD03A; + font-style: normal; +} + + + +/* START OF ADD FORM CSS */ + +form#zp-Add { + padding: 0; + margin: 0; +} +*:first-child+html form#zp-Add { /* IE7 hack */ + /*width: 850px;*/ +} +form#zp-Add fieldset { + background: transparent; + border: none; + margin: 0; + padding: 0; +} +form#zp-Add div.field { + clear: both; + padding: 2.2em 2.4em; +} + +form#zp-Add label, +form#zp-Add select, +form#zp-Add textarea, +form#zp-Add input, +form#zp-Add aside { + display: block; + float: left; +} +form#zp-Add select, +form#zp-Add textarea, +form#zp-Add input { + margin: -4px 0 0; +} +form#zp-Add input#private_key { + min-width: 18em; +} +form#zp-Add label { + font: italic 400 1.1em/1.25em "Georgia", serif; + width: 20%; +} +form#zp-Add label.required { + background: url('../images/sprite.png') no-repeat 0 -36px; + padding-left: 15px; + margin-left: -15px; +} +form#zp-Add aside { + float: right; + margin-top: -8px; + width: 40%; +} +form#zp-Add aside p { + font-size: 0.85em; + margin: 0 0 0 1em; +} +form#zp-Add .last aside p { + padding-bottom: 2em; +} + +form#zp-Add input#upload_image, +form#zp-Add input#upload_image_button { + display: inline; +}/* Remove once converted to WP types w/ post image? */ + +#zp-Setup div.proceed { + border-top: 1px solid #eee; + clear: both; + width: 100%; +} +#zp-Setup div.proceed input#zp-Connect, +#zp-Setup div.proceed input#zp-Connect-Next { + margin: 1em 30px 0.5em; + float: right; +} +/* Thanks to http://nicolasgallagher.com/micro-clearfix-hack/ */ +#zp-Setup div.proceed:before, +#zp-Setup div.proceed:after { + content: ""; + display: table; +} +#zp-Setup div.proceed:after { + clear: both; +} + +form#zp-Add div.message { + position: absolute; + bottom: 1.1em; + right: 8.5em; + width: 100%; +} +div.zp-Loading { + background: transparent url('../images/loading_default.gif') no-repeat center; + display: none; + float: right; + letter-spacing: -1000px; + overflow: hidden; + text-indent: -5000px; + margin: 0 0 0; + width: 30px; + height: 30px; +} +div.zp-Errors, +div.zp-Success { + display: none; + float: right; + font-weight: bold; + margin: 0 0 0; + padding-left: 35px; +} +div.zp-Errors { + background: url('../images/sprite.png') no-repeat 0 -139px; + color: #990033; +} +div.zp-Success { + background: url('../images/sprite.png') no-repeat 0 -76px; + color: #009966; +} +div.zp-Errors p, +div.zp-Success p { + margin: 5px 0; +} + +/* END OF SETUP CSS */ + + + +/* START OF LOADING CSS */ + +div.zp-Loading-Initial { + background: transparent url('../images/loading_initial.gif') no-repeat -3px 10px; + margin: 0; + padding: 0; + width: 220px; + height: 18px; +} +div.zp-Loading-Initial h2 { + margin-bottom: -12px; +} +iframe#zp-Loading-Initial { + visibility: hidden; +} + +/* END OF LOADING CSS */ + + + +/* START TABS */ + +div#zp-Zotpress-Navigation { + border-bottom: 1px solid #ccc; + margin: 10px 0 20px; + overflow: visible; + /*height: 47px;*/ + height: 49px; +} + +div#zp-Zotpress-Navigation h1 { + font: 600 18px/24px "Helvetica", Arial, sans-serif; + float: left; + margin: 0; + padding: 0.45em 5em 1em 0; + text-transform: uppercase; +} +div#zp-Zotpress-Navigation h1 em { + color: #c23d35; + font-style: normal; +} + +/* Nav Items */ + +div#zp-Zotpress-Navigation .nav-item, +div#zp-Zotpress-Navigation :visited.nav-item { + color: #000; + display: block; + float: left; + /*font: normal 15px/24px "Helvetica", "Helvetica Neue", "Arial", sans-serif;*/ + font: normal 1em/2.15em "Helvetica", "Helvetica Neue", "Arial", sans-serif; + padding: 0.75em 1.5em; + outline: none; + text-transform: uppercase; + text-decoration: none; +} +div#zp-Setup:not(.zp-Step-Selective) div#zp-Zotpress-Navigation .nav-item, +div#zp-Setup:not(.zp-Step-Selective) div#zp-Zotpress-Navigation :visited.nav-item { + color: #bbb; +} + +div#zp-Zotpress-Navigation :hover.nav-item { + border-bottom: 0.25em solid #000; +} +div#zp-Setup:not(.zp-Step-Selective) div#zp-Zotpress-Navigation :hover.nav-item { + border-bottom: none; +} + +div#zp-Zotpress-Navigation :focus.nav-item, +div#zp-Zotpress-Navigation :active.nav-item, +div#zp-Zotpress-Navigation .active.nav-item { + background-color: #eaeaea; + border-bottom: 0.25em solid #000; + box-shadow: none; +} + +div#zp-Zotpress-Navigation .nav-item.nav-tab-active, +div#zp-Setup div#zp-Zotpress-Navigation .nav-item.nav-tab-active, +div#zp-Setup div#zp-Zotpress-Navigation .nav-item.nav-tab-active:hover, +div#zp-Setup div#zp-Zotpress-Navigation .nav-item.nav-tab-active:active { + border-bottom: 0.25em solid #E14D43; + background-color: transparent; + color: #000; +} + +div#zp-Zotpress-Navigation .nav-item.nav-tab-active strong { + font-weight: bold; + margin-right: 0.25em; +} + +div#zp-Icon { + float: left; + margin-right: 8px; + text-align: center; + width: 48px; + height: 48px; +} +div#zp-Icon img { + display: inline; + padding-top: 6px; + width: 32px; +} + +/* END TABS */ + + + +/* START BROWSE */ + +/* from ID to class: + +zp-Options-Wrapper +zp-Browse-Wrapper +zp-Browse-Bar +.zp-Browse-Collections, +.zp-Browse-Tags + +*/ + +div#zp-Zotpress div#zp-Options-Wrapper, +div#zp-Zotpress div.zp-Browse-Wrapper { + position: relative; + background-color: #fff; + border-bottom: 1px solid #ccc; + margin-top: -20px; + padding: 1em 0 0; +} +div#zp-Zotpress div#zp-Options-Wrapper:before, +div#zp-Zotpress div#zp-Options-Wrapper:after { + content: ""; + display: table; +} +div#zp-Zotpress div#zp-Options-Wrapper:after { + clear: both; +} +div#zp-Zotpress div#zp-Options-Wrapper h3, +div#zp-Zotpress div.zp-Browse-Wrapper h3 { + padding: 15px 30px 25px; +} +div#zp-Zotpress div#zp-Options-Wrapper h3 { + border-bottom: 1px solid #eee; +} + +div#zp-Zotpress div#zp-Options-Wrapper hr { + border-color: #eee; + margin-bottom: 0; +} +div#zp-Zotpress div#zp-Options-Wrapper div.zp-Column-1, +div#zp-Zotpress div#zp-Options-Wrapper div.zp-Column-2 { + border-color: #eee; + margin-right: 0; + width: 49.5%; +} +div#zp-Zotpress div#zp-Options-Wrapper div.zp-Column-Inner { + padding: 0 25px; +} + + +/* Browse Dropdowns */ + +.zp-Browse-Bar { + border: none; + padding: 0 30px; +} +.zp-Browse-Bar:after { + clear: both; + content: ""; + display: table; +} + +.zp-Browse-Collections, +.zp-Browse-Tags { + float: left; + width: 50%; +} +.zp-Browse-Select { + /* padding: 0 30px; */ + margin-right: 15px; + width: auto; +} +.zp-Browse-Tags .zp-Browse-Select { + margin-right: 0; + margin-left: 15px; +} + +.zp-Browse-Select select { + border: 1px solid #ccc; + width: 100%; +} + +.zp-Browse-Select .zp-List-Tags { + float: right; +} + + + +/* Accounts */ + +div.zp-Browse-Accounts { + display: inline; +} +div.zp-Browse-Accounts label { + color: #ccc; + display: none; + font: normal 400 1em/1.75em "Georgia", serif; + margin-right: 5px; + padding: 0; +} +div#zp-Zotpress select.zp-FilterByAccount { + font-size: inherit; + line-height: inherit; + border: none; + box-shadow: none; + margin: 0; + padding: 0; + display: inline; + height: auto; + vertical-align: baseline; +} +div#zp-Zotpress select.zp-FilterByAccount.loading { + color: #ddd; +} + +div.zp-Browse-Account-Options { + position: absolute; + top: 27px; + right: 30px; +} +.zp-Browse-Account-Default { + font: 400 27px/32px "Helvetica", "Helvetica Neue", "Arial", sans-serif; + padding-left: 3px !important; + transition: none !important; + width: auto; +} +.zp-Browse-Account-Default:before { + font-family: dashicons; + content: "\f154"; + line-height: 1.1; + font-size: 1.1em; + margin: 0 0.4em; + padding: 0 0.1em; + vertical-align: text-bottom; +} +.zp-Browse-Account-Default.dashicons-star-empty:before { + content: "\f154"; +} +.zp-Browse-Account-Default.dashicons-star-filled:before { + content: "\f155"; +} +.zp-Browse-Account-Default.loading:before { + background-image: url("../images/loading_default.gif") !important; + background-repeat: no-repeat; + background-position: center !important; + height: 1.5rem; +} +.zp-Browse-Account-Default.loading.dashicons-star-empty:before { + content: " "; + display: inline-block; + white-space: pre; + vertical-align: 0.1em; + min-height: 18px; + min-width: 18px; +} + + +/* Collection Folders */ + +div.zp-Collection-Title { + letter-spacing: normal; + margin-left: 30px; + padding: 0; + text-transform: none; +} +div.zp-Collection-Title label { + color: #ccc; + display: inline-block; + font-family: "Georgia", serif; + font-size: 0.65em; + font-style: normal; + padding-left: 2em; + text-transform: uppercase; +} +div.zp-Collection-Title .item_key { + border: none; + box-shadow: none; + color: #ccc; + display: inline-block; + font-size: 0.8em; + font-style: italic; +} + +/* END BROWSE */ + + + +/* START OF BROWSE CITATION LISTS */ + +.zpSearchResultsContainer { + border-top: 1px solid #eee; +} +.wp-admin .zpSearchResultsContainer { + padding-bottom: 0; +} +.wp-admin div#zp-Zotpress div.zp-List .zp_display_progress { + position: absolute; + top: 0; + right: 0; + + background: transparent url('../images/loading_default.gif') no-repeat right top; + font-size: 0.8em; + text-transform: uppercase; + margin-right: 30px; + padding-right: 30px; +} +.wp-admin div#zp-Zotpress div.zp-List.loading .zpSearchResultsContainer { + background: none; +} + +div#zp-Zotpress div.zp-List { + position: relative; +} + +div#zp-Zotpress div.zp-List h3 { + display: block; + color: #bbb; + background: #333; + font: 400 19px/24px "Helvetica", "Helvetica Neue", "Arial", sans-serif; + margin: -3px 0 0; + padding: 10px 15px; +} +div#zp-Zotpress div.zp-List h3 em { + color: #fff; + font-style: normal; +} + +div#zp-Zotpress div.zp-List p { + margin: 1em; +} + +div#zp-Zotpress div.zp-List a, +div#zp-Zotpress div.zp-List a:visited +{ + color: #E14D43; /* bae1fe */ + text-decoration: none; +} +div#zp-Zotpress div.zp-List h3 a { + float: right; +} +div#zp-Zotpress div.zp-List a:hover { + color: #ddd; +} +div#zp-Zotpress div.zp-List a:active { + color: #666; +} + + + +div#zp-Zotpress div.zp-List div.zp-Entry { + padding: 0 30px; +} +div#zp-Zotpress div.zp-List div.zp-Entry:before, +div#zp-Zotpress div.zp-List div.zp-Entry:after { + content: ""; + display: table; +} +div#zp-Zotpress div.zp-List div.zp-Entry:after { + clear: both; +} +.wp-admin div#zp-Zotpress div.zp-List div.zp-Entry { + border-bottom: 1px solid #eee; + padding-top: 20px; +} + +div#zp-Zotpress div.zp-List div.zp-Entry label { + color: #ccc; + display: inline; + font-family: "Georgia", serif; + font-size: 0.85em; + text-transform: uppercase; +} +div#zp-Zotpress div.zp-List div.zp-Entry input.item_key { + border: none; + box-shadow: none; + color: #ccc; + display: inline-block; + font-family: "Georgia", serif; + font-style: italic; + font-weight: normal; + margin-bottom: 2em; +} + +div#zp-Zotpress div.zp-List div.zp-Entry-Image { + position: relative; + float: right; + margin: 0 0 5px 15px; + overflow: hidden; + text-align: center; + width: 150px; +} +div#zp-Zotpress div.zp-List div.zp-Entry-Image.hasImage { + line-height: 0; + width: 150px; + height: auto; +} + +div#zp-Zotpress div.zp-List div.zp-Entry-Image a.upload, +div#zp-Zotpress div.zp-List div.zp-Entry-Image a.upload:link, +div#zp-Zotpress div.zp-List div.zp-Entry-Image a.upload:visited { + transition: .25s ease-in-out; + + background-color: #F6F6F6; + border: 2px solid #F6F6F6; + border-bottom: 2px solid #eee; + color: #ccc; + display: block; + font-size: 0.9em; + font-weight: bold; + line-height: 2em; + text-decoration: none; + width: 150px; +} +div#zp-Zotpress div.zp-List div.zp-Entry-Image a.upload:hover { + background-color: #E14D43; + border: 2px solid #E14D43; + border-bottom: 2px solid #C24138; + color: #fff; +} +div#zp-Zotpress div.zp-List div.zp-Entry-Image a.upload:active { + background-color: #aaa; + border: 2px solid #aaa; + color: #666; +} +div#zp-Zotpress div.zp-List div.zp-Entry-Image a.delete, +div#zp-Zotpress div.zp-List div.zp-Entry-Image a.delete:link, +div#zp-Zotpress div.zp-List div.zp-Entry-Image a.delete:visited { + transition: .25s ease-in-out; + + position: absolute; + z-index: 3; + top: 0; + right: 0; + left: auto; + background-color: #F6F6F6; + border: 2px solid #F6F6F6; + border-bottom: 2px solid #eee; + box-shadow: none; + display: none; + font-size: 14pt; + font-weight: bold; + line-height: 20px; + outline: none; + text-align: center; + width: 25px; + height: 25px; +} +div#zp-Zotpress div.zp-List div.zp-Entry-Image a.delete:hover { + background-color: #E14D43; + border: 2px solid #E14D43; + border-bottom: 2px solid #C24138; + color: #fff; +} +div#zp-Zotpress div.zp-List div.zp-Entry-Image a.delete:active { + background-color: #aaa; + border: 2px solid #aaa; + color: #666; +} +div#zp-Zotpress div.zp-List div.zp-Entry-Image.hover.hasImage a.delete { + display: block; +} + +div#zp-Zotpress div.zp-List div.zp-Entry-Image img { + width: 150px; + height: auto; +} + +div#zp-Zotpress div.zp-Entry div.zp-Entry-ID { + color: #999; + font-size: 10px; + display: block; + margin: 0; +} +div#zp-Zotpress div.zp-Entry div.zp-Entry-ID span.title { + text-transform: uppercase; +} +div#zp-Zotpress div.zp-Entry div.zp-Entry-ID div { + display: inline-block; +} +div#zp-Zotpress div.zp-Entry div.zp-Entry-ID-Text span { + cursor: pointer; +} +div#zp-Zotpress div.zp-Entry div.zp-Entry-ID input { + border: 0; + background: transparent; + color: #999; + display: none; + font-size: 10px; + padding: 0; + margin: 0; +} + + +/* Pagination */ + +.zpSearchResultsPaging:after { + clear: both; + content: ""; + display: table; +} + +.zpSearchResultsPagingContainer { + margin: 0; + margin-left: 30px; +} + +.zpSearchResultsPagingContainer span.title { + font: italic 400 1rem/2.6 "Georgia", serif; + /* float: left; */ + /* padding: 7px 15px 0 0; */ + text-transform: none; +} + +.zpSearchResultsPaging a { + /* float: left; */ + display: block; + text-align: center; + /* width: 40px; */ + /* height: 3.5rem; */ +} +.zpSearchResultsPaging a.selected { + color: #000 !important; +} +.zpSearchResultsPaging a span { + margin: 0.5rem; + /* padding: calc(1.5rem - 4px) calc(1.2rem - 4px); */ +} + +.zpSearchResultsPagingScroller { + /* width: 5em; */ +} +.zpSearchResultsPagingScroller span { + font-size: 2.5rem; + margin-top: -0.5rem; +} + +/* END OF BROWSE CITATIONS */ + + + +/* START IMAGE FORM */ + +div#zp-Zotpress form#zp-Image { + /* -moz-border-radius: 10px; */ + border-radius: 10px; + background-color: #fafafa; + margin: 0.75em 0 30px 0; + width: 780px; +} + +div#zp-Zotpress form#zp-Image fieldset { + padding: 10px 20px; +} + +div#zp-Zotpress form#zp-Image div.section { + margin: 10px 0; +} + +div#zp-Zotpress form#zp-Image div.zp-Image-Current { + float: right; + overflow: hidden; + margin: 20px; + max-width: 310px; + max-height: 310px; +} + +div#zp-Zotpress div.zp-Citation { + width: 780px; +} +div#zp-Zotpress div.zp-Citation div.csl-bib-body { + margin: 0; +} +div#zp-Zotpress div.zp-Citation div.zp-Entry { + min-height: 0; +} + +div#zp-Zotpress form#zp-Image span.help { + color: #999; + font: italic 11px/14px 'Georgia', serif; +} + +div#zp-Zotpress form#zp-Image #zp-Submit, +div#zp-Zotpress form#zp-Image #zp-Cancel { + float: left; +} +div#zp-Zotpress form#zp-Image #zp-Submit { + margin-right: 4px; +} + +div#zp-Zotpress form#zp-Image div.zp-Loading { + display: none; + float: left; + margin: 0 0 0 4px; +} + +div#zp-Zotpress form#zp-Image div.zp-Errors, +div#zp-Zotpress form#zp-Image div.zp-Success { + margin-left: 140px; + padding-left: 35px; +} +div#zp-Zotpress form#zp-Image div.zp-Errors p, +div#zp-Zotpress form#zp-Image div.zp-Success p { + padding: 6px 0 1px; +} + +/* END IMAGE FORM */ + + + +/* START OF HIDDEN URL CSS */ + +span#ZOTPRESS_PLUGIN_URL { + display: none; +} + +/* END OF HIDDEN URL CSS */ + + + +/* START ACCOUNTS */ + +div#zp-ManageAccounts { + clear: both; +} +div#zp-ManageAccounts h3 { + width: 50%; +} + +a.zp-Account-Default.inactive { + cursor: default; +} + +a.zp-AddAccountButton, +a.zp-AddAccountButton:link, +a.zp-AddAccountButton:visited, +a.zp-AddAccountButton:active, +a.zp-AddAccountButton:hover { + float: right; + margin-top: -2.55em; + text-shadow: none; +} +a.zp-AddAccountButton span.dashicons { + color: #000; + margin-right: 0.3em; + padding-bottom: 3px; + vertical-align: middle; + /* background: transparent url('../images/sprite.png') no-repeat 0 -351px; */ + /* padding: 0 2px 0 16px; */ +} +a.zp-AddAccountButton:hover { + background: #ceec8a; +} +a.zp-AddAccountButton:hover span.dashicons { + color: #E14D43; + /* background-position: -161px -351px; */ +} +a.zp-AddAccountButton:active { + background: #777; + color: #000; +} +a.zp-AddAccountButton:active span.dashicons { + color: #666; + /* background-position: -161px -350px; */ +} + +#zp-Accounts { + margin: 1.55em 0; +} + +#zp-Accounts th { + font: 300 1.1em/1.1em "Georgia", sans-serif; +} + +#zp-Accounts .default { + text-align: center; + width: 10%; +} +#zp-Accounts .account_type { + width: 8%; +} +#zp-Accounts .api_user_id { + width: 12%; +} +#zp-Accounts .private_key { + width: 34%; +} +#zp-Accounts .nickname { + width: 20%; +} +#zp-Accounts .cache { + text-align: center; + width: 8%; +} +#zp-Accounts .remove { + text-align: center; + width: 8%; +} + +#zp-AccountsList td.cache, +#zp-AccountsList td.remove { + text-align: center; + /* display: flex; + align-items: center; + justify-content: center; + width: inherit; */ +} + +#zp-AccountsList .default a, +#zp-AccountsList .cache a, +#zp-AccountsList .remove a { +/* #zp-AccountsList .actions a { */ + /* display: block; */ + font-size: 1.7em; + line-height: 25px; + outline: none; + overflow: hidden; + margin: 0 1.25em 0 0; + width: 25px; + height: 25px; +} +#zp-AccountsList .default a span, +#zp-AccountsList .cache a span, +#zp-AccountsList .remove a span { + display: none; +} +#zp-AccountsList .default a.dashicons-star-filled { + color: #000; + content: "\f154"; +} +#zp-AccountsList .default a.dashicons-star-empty { + color: #ccc; + content: "\f155"; +} +#zp-AccountsList .default a:focus, +#zp-AccountsList .cache a:focus, +#zp-AccountsList .remove a:focus { +/* #zp-AccountsList .actions a:focus { */ + box-shadow: none; +} +#zp-AccountsList .cache a.cache { + color: #000; + /* color: #2ecc71; */ + margin-right: 0; + + /* -webkit-transform: scaleX(-1) rotate(25deg); + -moz-transform: scaleX(-1) rotate(25deg); + -o-transform: scaleX(-1) rotate(25deg); */ + transform: scaleX(-1) rotate(25deg); +} +#zp-AccountsList .cache a.cache.loading:before { + content: " "; + white-space: pre; + background-position: 0 center !important; + background-image: url('../images/loading_default.gif'); + background-repeat: no-repeat; + width: 18px; + display: inline-block; +} +#zp-AccountsList .remove a.delete { + color: #E14D43; + margin-right: 0; +} + +#zp-AccountsList .default a.default { + float: none; + margin: 0 auto; +} +#zp-AccountsList .default a.default.loading { + background-position: 4px center !important; + background-image: url('../images/loading_default.gif'); + background-repeat: no-repeat; +} +#zp-AccountsList .default a.default.loading:before { + content: " "; + white-space: pre; +} + +/* END ACCOUNTS */ + + + + + + +/* START OF MODAL CSS */ + +.zp-Modal #adminmenu, +.zp-Modal #footer, +.zp-Modal #wphead +{ + display: none; +} +.zp-Modal #wpbody { + margin-left: 25px; +} +body.wp-admin.zp-Modal { + min-width: 400px; +} + +/* END OF MODAL CSS */ + + + + +/* START OF OPTIONS PAGE CSS */ + +div.zp-Zotpress-Options { + border-left: 0.35em solid #000; + margin: 20px 0 30px; + padding: 0.6em 1em; +} +div.zp-Zotpress-Options:before, +div.zp-Zotpress-Options:after { + content: ""; + display: table; +} +div.zp-Zotpress-Options:after { + clear: both; +} + +div#zp-Zotpress div.zp-Column-1 { + border-right: 1px solid #ddd; + float: left; + margin-right: 4%; + width: 47.5% +} +div#zp-Zotpress div.zp-Column-2 { + float: left; + width: 47.5% +} + +div.zp-Zotpress-Options label { + font: normal 0.9em/1em "Georgia", sans-serif; + margin: 0 0 0.5em 0; + text-transform: uppercase; + letter-spacing: 0.075rem; +} + +div.zp-Zotpress-Options label, +div.zp-Zotpress-Options select { + display: block; +} +div.zp-Zotpress-Options select { + margin-bottom: 0.5em; +} + +div.zp-Zotpress-Options input.button-secondary { + float: left; + margin-top: 10px; +} + +div#zp-Zotpress div.zp-Zotpress-Options div.zp-Loading { + display: none; + float: left; + margin: 0.6em 0 0 0.25em; +} +div#zp-Zotpress div.zp-Zotpress-Options div.zp-Success, +div#zp-Zotpress div.zp-Zotpress-Options div.zp-Errors { + margin: 0.6em 0 0; + padding: 6px 0 4px 32px; + float: left; +} + +div#zp-Zotpress-Options-Style-New-Container { + display: none; + margin: 1.5em 0 0.5em; +} +select#zp-Zotpress-Options-Style option#new { + border-top: 1px dotted #CCCCCC; + font-weight: bold; + font-style: italic; +} + +div#zp-Zotpress .zp-Column-1 p.note { + /*margin-right: 1em;*/ +} + +div#zp-Zotpress-Options-Reset { + border-left: 0; + padding: 0; +} + +div.zp-CPT-Checkbox { + float: left; + width: 50%; +} +div.zp-Zotpress-Options div.zp-CPT-Checkbox label { + display: inline; + line-height: 2em; + vertical-align: 0.05em; +} +div.zp-Zotpress-Options div.zp-CPT-Checkbox label.dis { + color: #ccc; +} +div.zp-CPT-Checkbox-Container:before, +div.zp-CPT-Checkbox-Container:after { + content: " "; /* 1 */ + display: table; /* 2 */ +} +div.zp-CPT-Checkbox-Container:after { + clear: both; +} + +/* END OF OPTIONS PAGE CSS */ + + +.ui-tooltip-tipsy .ui-tooltip-titlebar, .ui-tooltip-tipsy .ui-tooltip-content { + font-weight: normal !important; + width: 300px !important; +} diff --git a/css/zotpress.admin.min.css b/css/zotpress.admin.min.css new file mode 100644 index 0000000..9fbc9ad --- /dev/null +++ b/css/zotpress.admin.min.css @@ -0,0 +1 @@ +div#zp-Zotpress select{cursor:pointer}div#zp-Zotpress div.zp-Col-1{float:left;width:350px}div#zp-Zotpress div.zp-Col-2{float:left}#adminmenu .current .wp-menu-image img{opacity:1}div#zp-Zotpress del{color:#aaa;text-decoration:none}div#zp-Setup h3,div#zp-Zotpress h3{clear:both;font:400 27px/32px Helvetica,"Helvetica Neue",Arial,sans-serif;margin:0;font-weight:700;padding:9px 15px 4px 0;text-transform:none}div#zp-Setup h3.pair{border-bottom:0;padding:15px 30px 0}div#zp-Setup h4,div#zp-Zotpress h4,div.zp-Collection-Title{font:italic 400 17px/21px Georgia,serif;margin:1.5em 0 1em}div#zp-Setup h4{font:italic 400 16px/21px Georgia,serif}div#zp-Setup h4.pair{border-bottom:1px solid #eee;margin:0;padding:10px 30px 25px}div#zp-Zotpress h5{font:300 11px/30px Georgia,serif;margin-bottom:-15px;text-transform:uppercase}div#zp-Zotpress hr{border:none;border-top:1px solid #ddd;clear:both;margin:3.3em 0 .7em;height:1px}div#zp-Setup hr.clear,div#zp-Zotpress hr.clear{border:none;margin-bottom:0}div#zp-Setup ul,div#zp-Zotpress ul{list-style:none;margin:20px 0 25px;padding:0}div#zp-Setup ul li,div#zp-Zotpress ul li{background:url('../images/sprite.png') no-repeat -40px -60px;padding-left:15px;margin-left:5px;margin-bottom:10px;list-style:none}div#zp-Zotpress form hr.clear{margin:0;padding:0;height:1px}div#zp-Zotpress p.example{font-family:monospace;font-size:1.1em}div#zp-Setup{border-bottom:1px solid #ccc;margin-right:1.5em;width:auto;min-width:549px}div#zp-Setup div#zp-Zotpress-Navigation{z-index:1;position:relative;margin-bottom:0}div#zp-Setup-Step,div.zp-Setup-Step{z-index:0;position:relative;background-color:#fff;padding:1em 0 .65em}div.zp-Setup-Step.second{border-top:1px solid #eee}div.zp-Setup-Step.second:after,div.zp-Setup-Step.second:before{display:table;content:""}div.zp-Setup-Step.second:after{clear:both}div#zp-Setup h3{padding:15px 30px 25px;border-bottom:1px solid #eee}div#zp-Setup-Step hr{clear:both;border:none;padding:0;margin:1em 0;height:1px;background:0 0;border-top:1px solid #eee}div#zp-Setup-Step hr.clear{margin:0}div#zp-Setup div.zp-Column-1,div#zp-Setup div.zp-Column-2{float:left;margin-left:30px;width:400px}div#zp-Setup p.note{color:#666;font-size:.9em;font-style:italic;margin:-10px 0 10px 0}div#zp-Setup div.zp-Zotpress-Options{margin-bottom:2em}div#zp-Zotpress-Setup-Buttons{clear:both;border-top:1px solid #eee}a#zp-Setup-Cancel,div#zp-Zotpress-Setup-Buttons a,div#zp-Zotpress-Setup-Buttons input{margin:1em 30px .5em;float:right}a#zp-Setup-Cancel{float:none}div#zp-Zotpress-Setup-Buttons a#zp-Import-Accounts-Button{margin-right:0}div#zp-Zotpress-Setup-Buttons a#zp-Import-Browse-Button{margin-left:10px}div#zp-Setup div.zp-Zotpress-Options div.zp-Errors,div#zp-Setup div.zp-Zotpress-Options div.zp-Loading,div#zp-Setup div.zp-Zotpress-Options div.zp-Success{float:left;height:32px}div#zp-Setup div.zp-Zotpress-Options div.zp-Errors,div#zp-Setup div.zp-Zotpress-Options div.zp-Success{margin-top:14px;margin-bottom:0;padding-left:35px;height:24px}div#zp-Setup div.zp-Zotpress-Options div.zp-Success{background-position:0 -82px}div#zp-Setup div.zp-Zotpress-Options div.zp-Errors{background-position:0 -146px}div#zp-Setup div.zp-Zotpress-Options div.zp-Loading{margin-top:6px}div#zp-Setup div.zp-Column,div#zp-Zotpress div.zp-Column{border-bottom:1px solid #eee}div#zp-Setup div.zp-Column div.zp-Column-Inner{padding:0 25px}div#zp-Step-Import,div.zp-Step-Import{padding:10px 30px}.second div.zp-Step-Import{padding-top:0}div#zp-Zotpress-Setup-Import-Buttons{margin-top:2em}.wp-core-ui input.zp-Import-Button.button-secondary,input#zp-Zotpress-Setup-Import{margin:0 .5em 1em 0;float:left}div#zp-Step-Import-Collection{background-color:#f9f9f9;clear:both;margin-top:1em;width:36.75em;height:13.5em}div#zp-Step-Import-Collection.loading{background:#f9f9f9 url('../images/loading_default.gif') no-repeat center}div#zp-Step-Import-Collection iframe{width:100%}#zp-Zotpress-Setup-Import-Selective{float:left;margin:1em 0}iframe#zp-Setup-Import{position:absolute;top:0;right:0;margin:0;padding:0;visibility:hidden;width:50px;height:35px}div.zp-Loading-Container{clear:both;padding-top:.75em}div.zp-Loading-Container:after,div.zp-Loading-Container:before{content:"";display:table}div.zp-Loading-Container:after{clear:both}div.zp-Loading-Container.selective{clear:none;padding-top:0}div.zp-Loading-Initial.zp-Loading-Import{background:transparent url('../images/loading_import.gif') no-repeat 0 6px;display:none;float:left;margin:0;width:70px;height:20px}div.zp-Loading-Initial.zp-Loading-Import.selective{margin-top:1.35em;margin-left:1em}div.zp-Import-Messages{color:#999;font:italic 9px/20px Georgia,"Times New Roman","Bitstream Charter",Times,serif;display:none;float:left;margin:0 0 0 1em}div.zp-Import-Messages.selective{margin-top:1.95em}div.Zotpress_update_notice .notice-dismiss.text{position:static;color:inherit;text-decoration:underline;padding:0}div.Zotpress_update_notice .notice-dismiss.text::before{display:none}#zp-Setup-Check{padding:1.5em 30px}#zp-Setup-Check-Message.error{background:#fceae9}#zp-Setup-Check-Message.updated{background:#eef9e6}div#zp-Setup-Check-Message.error strong em{color:#e14d43;font-style:normal}div#zp-Setup-Check-Message.updated strong em{color:#7ad03a;font-style:normal}form#zp-Add{padding:0;margin:0}form#zp-Add fieldset{background:0 0;border:none;margin:0;padding:0}form#zp-Add div.field{clear:both;padding:2.2em 2.4em}form#zp-Add aside,form#zp-Add input,form#zp-Add label,form#zp-Add select,form#zp-Add textarea{display:block;float:left}form#zp-Add input,form#zp-Add select,form#zp-Add textarea{margin:-4px 0 0}form#zp-Add input#private_key{min-width:18em}form#zp-Add label{font:italic 400 1.1em/1.25em Georgia,serif;width:20%}form#zp-Add label.required{background:url('../images/sprite.png') no-repeat 0 -36px;padding-left:15px;margin-left:-15px}form#zp-Add aside{float:right;margin-top:-8px;width:40%}form#zp-Add aside p{font-size:.85em;margin:0 0 0 1em}form#zp-Add .last aside p{padding-bottom:2em}form#zp-Add input#upload_image,form#zp-Add input#upload_image_button{display:inline}#zp-Setup div.proceed{border-top:1px solid #eee;clear:both;width:100%}#zp-Setup div.proceed input#zp-Connect,#zp-Setup div.proceed input#zp-Connect-Next{margin:1em 30px .5em;float:right}#zp-Setup div.proceed:after,#zp-Setup div.proceed:before{content:"";display:table}#zp-Setup div.proceed:after{clear:both}form#zp-Add div.message{position:absolute;bottom:1.1em;right:8.5em;width:100%}div.zp-Loading{background:transparent url('../images/loading_default.gif') no-repeat center;display:none;float:right;letter-spacing:-1000px;overflow:hidden;text-indent:-5000px;margin:0 0 0;width:30px;height:30px}div.zp-Errors,div.zp-Success{display:none;float:right;font-weight:700;margin:0 0 0;padding-left:35px}div.zp-Errors{background:url('../images/sprite.png') no-repeat 0 -139px;color:#903}div.zp-Success{background:url('../images/sprite.png') no-repeat 0 -76px;color:#096}div.zp-Errors p,div.zp-Success p{margin:5px 0}div.zp-Loading-Initial{background:transparent url('../images/loading_initial.gif') no-repeat -3px 10px;margin:0;padding:0;width:220px;height:18px}div.zp-Loading-Initial h2{margin-bottom:-12px}iframe#zp-Loading-Initial{visibility:hidden}div#zp-Zotpress-Navigation{border-bottom:1px solid #ccc;margin:10px 0 20px;overflow:visible;height:49px}div#zp-Zotpress-Navigation h1{font:600 18px/24px Helvetica,Arial,sans-serif;float:left;margin:0;padding:.45em 5em 1em 0;text-transform:uppercase}div#zp-Zotpress-Navigation h1 em{color:#c23d35;font-style:normal}div#zp-Zotpress-Navigation .nav-item,div#zp-Zotpress-Navigation :visited.nav-item{color:#000;display:block;float:left;font:normal 1em/2.15em Helvetica,"Helvetica Neue",Arial,sans-serif;padding:.75em 1.5em;outline:0;text-transform:uppercase;text-decoration:none}div#zp-Setup:not(.zp-Step-Selective) div#zp-Zotpress-Navigation .nav-item,div#zp-Setup:not(.zp-Step-Selective) div#zp-Zotpress-Navigation :visited.nav-item{color:#bbb}div#zp-Zotpress-Navigation :hover.nav-item{border-bottom:.25em solid #000}div#zp-Setup:not(.zp-Step-Selective) div#zp-Zotpress-Navigation :hover.nav-item{border-bottom:none}div#zp-Zotpress-Navigation .active.nav-item,div#zp-Zotpress-Navigation :active.nav-item,div#zp-Zotpress-Navigation :focus.nav-item{background-color:#eaeaea;border-bottom:.25em solid #000;box-shadow:none}div#zp-Setup div#zp-Zotpress-Navigation .nav-item.nav-tab-active,div#zp-Setup div#zp-Zotpress-Navigation .nav-item.nav-tab-active:active,div#zp-Setup div#zp-Zotpress-Navigation .nav-item.nav-tab-active:hover,div#zp-Zotpress-Navigation .nav-item.nav-tab-active{border-bottom:.25em solid #e14d43;background-color:transparent;color:#000}div#zp-Zotpress-Navigation .nav-item.nav-tab-active strong{font-weight:700;margin-right:.25em}div#zp-Icon{float:left;margin-right:8px;text-align:center;width:48px;height:48px}div#zp-Icon img{display:inline;padding-top:6px;width:32px}div#zp-Zotpress div#zp-Options-Wrapper,div#zp-Zotpress div.zp-Browse-Wrapper{position:relative;background-color:#fff;border-bottom:1px solid #ccc;margin-top:-20px;padding:1em 0 0}div#zp-Zotpress div#zp-Options-Wrapper:after,div#zp-Zotpress div#zp-Options-Wrapper:before{content:"";display:table}div#zp-Zotpress div#zp-Options-Wrapper:after{clear:both}div#zp-Zotpress div#zp-Options-Wrapper h3,div#zp-Zotpress div.zp-Browse-Wrapper h3{padding:15px 30px 25px}div#zp-Zotpress div#zp-Options-Wrapper h3{border-bottom:1px solid #eee}div#zp-Zotpress div#zp-Options-Wrapper hr{border-color:#eee;margin-bottom:0}div#zp-Zotpress div#zp-Options-Wrapper div.zp-Column-1,div#zp-Zotpress div#zp-Options-Wrapper div.zp-Column-2{border-color:#eee;margin-right:0;width:49.5%}div#zp-Zotpress div#zp-Options-Wrapper div.zp-Column-Inner{padding:0 25px}.zp-Browse-Bar{border:none;padding:0 30px}.zp-Browse-Bar:after{clear:both;content:"";display:table}.zp-Browse-Collections,.zp-Browse-Tags{float:left;width:50%}.zp-Browse-Select{margin-right:15px;width:auto}.zp-Browse-Tags .zp-Browse-Select{margin-right:0;margin-left:15px}.zp-Browse-Select select{border:1px solid #ccc;width:100%}.zp-Browse-Select .zp-List-Tags{float:right}div.zp-Browse-Accounts{display:inline}div.zp-Browse-Accounts label{color:#ccc;display:none;font:normal 400 1em/1.75em Georgia,serif;margin-right:5px;padding:0}div#zp-Zotpress select.zp-FilterByAccount{font-size:inherit;line-height:inherit;border:none;box-shadow:none;margin:0;padding:0;display:inline;height:auto;vertical-align:baseline}div#zp-Zotpress select.zp-FilterByAccount.loading{color:#ddd}div.zp-Browse-Account-Options{position:absolute;top:27px;right:30px}.zp-Browse-Account-Default{font:400 27px/32px Helvetica,"Helvetica Neue",Arial,sans-serif;padding-left:3px!important;transition:none!important;width:auto}.zp-Browse-Account-Default:before{font-family:dashicons;content:"\f154";line-height:1.1;font-size:1.1em;margin:0 .4em;padding:0 .1em;vertical-align:text-bottom}.zp-Browse-Account-Default.dashicons-star-empty:before{content:"\f154"}.zp-Browse-Account-Default.dashicons-star-filled:before{content:"\f155"}.zp-Browse-Account-Default.loading:before{background-image:url("../images/loading_default.gif")!important;background-repeat:no-repeat;background-position:center!important;height:1.5rem}.zp-Browse-Account-Default.loading.dashicons-star-empty:before{content:" ";display:inline-block;white-space:pre;vertical-align:.1em;min-height:18px;min-width:18px}div.zp-Collection-Title{letter-spacing:normal;margin-left:30px;padding:0;text-transform:none}div.zp-Collection-Title label{color:#ccc;display:inline-block;font-family:Georgia,serif;font-size:.65em;font-style:normal;padding-left:2em;text-transform:uppercase}div.zp-Collection-Title .item_key{border:none;box-shadow:none;color:#ccc;display:inline-block;font-size:.8em;font-style:italic}.zpSearchResultsContainer{border-top:1px solid #eee}.wp-admin .zpSearchResultsContainer{padding-bottom:0}.wp-admin div#zp-Zotpress div.zp-List .zp_display_progress{position:absolute;top:0;right:0;background:transparent url('../images/loading_default.gif') no-repeat right top;font-size:.8em;text-transform:uppercase;margin-right:30px;padding-right:30px}.wp-admin div#zp-Zotpress div.zp-List.loading .zpSearchResultsContainer{background:0 0}div#zp-Zotpress div.zp-List{position:relative}div#zp-Zotpress div.zp-List h3{display:block;color:#bbb;background:#333;font:400 19px/24px Helvetica,"Helvetica Neue",Arial,sans-serif;margin:-3px 0 0;padding:10px 15px}div#zp-Zotpress div.zp-List h3 em{color:#fff;font-style:normal}div#zp-Zotpress div.zp-List p{margin:1em}div#zp-Zotpress div.zp-List a,div#zp-Zotpress div.zp-List a:visited{color:#e14d43;text-decoration:none}div#zp-Zotpress div.zp-List h3 a{float:right}div#zp-Zotpress div.zp-List a:hover{color:#ddd}div#zp-Zotpress div.zp-List a:active{color:#666}div#zp-Zotpress div.zp-List div.zp-Entry{padding:0 30px}div#zp-Zotpress div.zp-List div.zp-Entry:after,div#zp-Zotpress div.zp-List div.zp-Entry:before{content:"";display:table}div#zp-Zotpress div.zp-List div.zp-Entry:after{clear:both}.wp-admin div#zp-Zotpress div.zp-List div.zp-Entry{border-bottom:1px solid #eee;padding-top:20px}div#zp-Zotpress div.zp-List div.zp-Entry label{color:#ccc;display:inline;font-family:Georgia,serif;font-size:.85em;text-transform:uppercase}div#zp-Zotpress div.zp-List div.zp-Entry input.item_key{border:none;box-shadow:none;color:#ccc;display:inline-block;font-family:Georgia,serif;font-style:italic;font-weight:400;margin-bottom:2em}div#zp-Zotpress div.zp-List div.zp-Entry-Image{position:relative;float:right;margin:0 0 5px 15px;overflow:hidden;text-align:center;width:150px}div#zp-Zotpress div.zp-List div.zp-Entry-Image.hasImage{line-height:0;width:150px;height:auto}div#zp-Zotpress div.zp-List div.zp-Entry-Image a.upload,div#zp-Zotpress div.zp-List div.zp-Entry-Image a.upload:link,div#zp-Zotpress div.zp-List div.zp-Entry-Image a.upload:visited{transition:.25s ease-in-out;background-color:#f6f6f6;border:2px solid #f6f6f6;border-bottom:2px solid #eee;color:#ccc;display:block;font-size:.9em;font-weight:700;line-height:2em;text-decoration:none;width:150px}div#zp-Zotpress div.zp-List div.zp-Entry-Image a.upload:hover{background-color:#e14d43;border:2px solid #e14d43;border-bottom:2px solid #c24138;color:#fff}div#zp-Zotpress div.zp-List div.zp-Entry-Image a.upload:active{background-color:#aaa;border:2px solid #aaa;color:#666}div#zp-Zotpress div.zp-List div.zp-Entry-Image a.delete,div#zp-Zotpress div.zp-List div.zp-Entry-Image a.delete:link,div#zp-Zotpress div.zp-List div.zp-Entry-Image a.delete:visited{transition:.25s ease-in-out;position:absolute;z-index:3;top:0;right:0;left:auto;background-color:#f6f6f6;border:2px solid #f6f6f6;border-bottom:2px solid #eee;box-shadow:none;display:none;font-size:14pt;font-weight:700;line-height:20px;outline:0;text-align:center;width:25px;height:25px}div#zp-Zotpress div.zp-List div.zp-Entry-Image a.delete:hover{background-color:#e14d43;border:2px solid #e14d43;border-bottom:2px solid #c24138;color:#fff}div#zp-Zotpress div.zp-List div.zp-Entry-Image a.delete:active{background-color:#aaa;border:2px solid #aaa;color:#666}div#zp-Zotpress div.zp-List div.zp-Entry-Image.hover.hasImage a.delete{display:block}div#zp-Zotpress div.zp-List div.zp-Entry-Image img{width:150px;height:auto}div#zp-Zotpress div.zp-Entry div.zp-Entry-ID{color:#999;font-size:10px;display:block;margin:0}div#zp-Zotpress div.zp-Entry div.zp-Entry-ID span.title{text-transform:uppercase}div#zp-Zotpress div.zp-Entry div.zp-Entry-ID div{display:inline-block}div#zp-Zotpress div.zp-Entry div.zp-Entry-ID-Text span{cursor:pointer}div#zp-Zotpress div.zp-Entry div.zp-Entry-ID input{border:0;background:0 0;color:#999;display:none;font-size:10px;padding:0;margin:0}.zpSearchResultsPaging:after{clear:both;content:"";display:table}.zpSearchResultsPagingContainer{margin:0;margin-left:30px}.zpSearchResultsPagingContainer span.title{font:italic 400 1rem/2.6 Georgia,serif;text-transform:none}.zpSearchResultsPaging a{display:block;text-align:center}.zpSearchResultsPaging a.selected{color:#000!important}.zpSearchResultsPaging a span{margin:.5rem}.zpSearchResultsPagingScroller span{font-size:2.5rem;margin-top:-.5rem}div#zp-Zotpress form#zp-Image{border-radius:10px;background-color:#fafafa;margin:.75em 0 30px 0;width:780px}div#zp-Zotpress form#zp-Image fieldset{padding:10px 20px}div#zp-Zotpress form#zp-Image div.section{margin:10px 0}div#zp-Zotpress form#zp-Image div.zp-Image-Current{float:right;overflow:hidden;margin:20px;max-width:310px;max-height:310px}div#zp-Zotpress div.zp-Citation{width:780px}div#zp-Zotpress div.zp-Citation div.csl-bib-body{margin:0}div#zp-Zotpress div.zp-Citation div.zp-Entry{min-height:0}div#zp-Zotpress form#zp-Image span.help{color:#999;font:italic 11px/14px Georgia,serif}div#zp-Zotpress form#zp-Image #zp-Cancel,div#zp-Zotpress form#zp-Image #zp-Submit{float:left}div#zp-Zotpress form#zp-Image #zp-Submit{margin-right:4px}div#zp-Zotpress form#zp-Image div.zp-Loading{display:none;float:left;margin:0 0 0 4px}div#zp-Zotpress form#zp-Image div.zp-Errors,div#zp-Zotpress form#zp-Image div.zp-Success{margin-left:140px;padding-left:35px}div#zp-Zotpress form#zp-Image div.zp-Errors p,div#zp-Zotpress form#zp-Image div.zp-Success p{padding:6px 0 1px}span#ZOTPRESS_PLUGIN_URL{display:none}div#zp-ManageAccounts{clear:both}div#zp-ManageAccounts h3{width:50%}a.zp-Account-Default.inactive{cursor:default}a.zp-AddAccountButton,a.zp-AddAccountButton:active,a.zp-AddAccountButton:hover,a.zp-AddAccountButton:link,a.zp-AddAccountButton:visited{float:right;margin-top:-2.55em;text-shadow:none}a.zp-AddAccountButton span.dashicons{color:#000;margin-right:.3em;padding-bottom:3px;vertical-align:middle}a.zp-AddAccountButton:hover{background:#ceec8a}a.zp-AddAccountButton:hover span.dashicons{color:#e14d43}a.zp-AddAccountButton:active{background:#777;color:#000}a.zp-AddAccountButton:active span.dashicons{color:#666}#zp-Accounts{margin:1.55em 0}#zp-Accounts th{font:300 1.1em/1.1em Georgia,sans-serif}#zp-Accounts .default{text-align:center;width:10%}#zp-Accounts .account_type{width:8%}#zp-Accounts .api_user_id{width:12%}#zp-Accounts .private_key{width:34%}#zp-Accounts .nickname{width:20%}#zp-Accounts .cache{text-align:center;width:8%}#zp-Accounts .remove{text-align:center;width:8%}#zp-AccountsList td.cache,#zp-AccountsList td.remove{text-align:center}#zp-AccountsList .cache a,#zp-AccountsList .default a,#zp-AccountsList .remove a{font-size:1.7em;line-height:25px;outline:0;overflow:hidden;margin:0 1.25em 0 0;width:25px;height:25px}#zp-AccountsList .cache a span,#zp-AccountsList .default a span,#zp-AccountsList .remove a span{display:none}#zp-AccountsList .default a.dashicons-star-filled{color:#000;content:"\f154"}#zp-AccountsList .default a.dashicons-star-empty{color:#ccc;content:"\f155"}#zp-AccountsList .cache a:focus,#zp-AccountsList .default a:focus,#zp-AccountsList .remove a:focus{box-shadow:none}#zp-AccountsList .cache a.cache{color:#000;margin-right:0;transform:scaleX(-1) rotate(25deg)}#zp-AccountsList .cache a.cache.loading:before{content:" ";white-space:pre;background-position:0 center!important;background-image:url('../images/loading_default.gif');background-repeat:no-repeat;width:18px;display:inline-block}#zp-AccountsList .remove a.delete{color:#e14d43;margin-right:0}#zp-AccountsList .default a.default{float:none;margin:0 auto}#zp-AccountsList .default a.default.loading{background-position:4px center!important;background-image:url('../images/loading_default.gif');background-repeat:no-repeat}#zp-AccountsList .default a.default.loading:before{content:" ";white-space:pre}.zp-Modal #adminmenu,.zp-Modal #footer,.zp-Modal #wphead{display:none}.zp-Modal #wpbody{margin-left:25px}body.wp-admin.zp-Modal{min-width:400px}div.zp-Zotpress-Options{border-left:.35em solid #000;margin:20px 0 30px;padding:.6em 1em}div.zp-Zotpress-Options:after,div.zp-Zotpress-Options:before{content:"";display:table}div.zp-Zotpress-Options:after{clear:both}div#zp-Zotpress div.zp-Column-1{border-right:1px solid #ddd;float:left;margin-right:4%;width:47.5%}div#zp-Zotpress div.zp-Column-2{float:left;width:47.5%}div.zp-Zotpress-Options label{font:normal 0.9em/1em Georgia,sans-serif;margin:0 0 .5em 0;text-transform:uppercase;letter-spacing:.075rem}div.zp-Zotpress-Options label,div.zp-Zotpress-Options select{display:block}div.zp-Zotpress-Options select{margin-bottom:.5em}div.zp-Zotpress-Options input.button-secondary{float:left;margin-top:10px}div#zp-Zotpress div.zp-Zotpress-Options div.zp-Loading{display:none;float:left;margin:.6em 0 0 .25em}div#zp-Zotpress div.zp-Zotpress-Options div.zp-Errors,div#zp-Zotpress div.zp-Zotpress-Options div.zp-Success{margin:.6em 0 0;padding:6px 0 4px 32px;float:left}div#zp-Zotpress-Options-Style-New-Container{display:none;margin:1.5em 0 .5em}select#zp-Zotpress-Options-Style option#new{border-top:1px dotted #ccc;font-weight:700;font-style:italic}div#zp-Zotpress-Options-Reset{border-left:0;padding:0}div.zp-CPT-Checkbox{float:left;width:50%}div.zp-Zotpress-Options div.zp-CPT-Checkbox label{display:inline;line-height:2em;vertical-align:.05em}div.zp-Zotpress-Options div.zp-CPT-Checkbox label.dis{color:#ccc}div.zp-CPT-Checkbox-Container:after,div.zp-CPT-Checkbox-Container:before{content:" ";display:table}div.zp-CPT-Checkbox-Container:after{clear:both}.ui-tooltip-tipsy .ui-tooltip-content,.ui-tooltip-tipsy .ui-tooltip-titlebar{font-weight:400!important;width:300px!important} diff --git a/css/zotpress.ckeditor.css b/css/zotpress.ckeditor.css deleted file mode 100644 index 6f63990..0000000 --- a/css/zotpress.ckeditor.css +++ /dev/null @@ -1,170 +0,0 @@ -.zp-ZotpressShortcode { - background-color: #eee; -} - - - - - .zotpress-widget-ckeditor-php #adminmenuback, - .zotpress-widget-ckeditor-php #adminmenuwrap, - .zotpress-widget-ckeditor-php #footer, - .zotpress-widget-ckeditor-php #wpadminbar - { - display: none !important; - } - - /* Body */ - - body.zotpress-widget-ckeditor-php { - background-color: #EBEBEB; - } - - body.zotpress-widget-ckeditor-php.admin-bar #wpcontent, - body.zotpress-widget-ckeditor-php.admin-bar #adminmenu { - margin: 0; - padding: 0; - } - - #wpbody-content { - padding-bottom: 0; - } - - div#zp-Zotpress-CkEditor.citation { - background-color: #fafafa; - border-radius: 7px; - -moz-border-radius: 7px; - } - - - /* Tabs */ - - div#zp-Zotpress-CkEditor-0 { - padding: 6px !important; - width: 584px; - } - .citation div#zp-Zotpress-CkEditor-0 { - padding: 0 !important; - width: 592px; - } - - div#zp-Zotpress-CkEditor ul.ui-widget-header { - border: 1px solid #aaa; - border-bottom: none; - } - - div#zp-Zotpress-CkEditor div#zp-ZotpressMetaBox-Tabs ul.ui-widget-header { - border: 1px solid #efefef; - border-bottom: none; - background: #f0f0f0; - } - - div#zp-ZotpressMetaBox-Tabs { - overflow: hidden; - margin-bottom: 0; - width: 580px; - } - .citation div#zp-ZotpressMetaBox-Tabs { - width: 588px; - } - - div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li { - margin-right: 2px; - } - - div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li a { - color: #888; - letter-spacing: 0; - - } - div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li.ui-state-active a { - color: #bbb; - } - - div#zp-Zotpress-CkEditor div#zp-ZotpressMetaBox-Tabs .zp-Tab { - width: 560px; - height: 250px; - } - - /* Frames */ - - div#zp-Zotpress-Frame-Left { - border-right: 1px solid #eee; - float: left; - padding-right: 10px; - width: 200px; - } - - div#zp-Zotpress-Frame-Right { - float: left; - padding-left: 10px; - width: 338px; - } - - /* Form */ - - div#zp-ZotpressMetaBox-Tabs div.zp-Loading { - position: absolute; - top: 50px; - } - - .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { - font-size: 11px; - } - - div#zp-Zotpress-Collection-Account-Select { - float: right; - margin-top: -32px; - margin-right: -17px; - } - div#zp-ZotpressMetaBox-Tabs div.zp-Tab select#zp-ZotpressMetaBox-Collection-Accounts { - margin-bottom: 0; - width: 215px; - height: 22px; - } - - div#zp-Zotpress-CkEditor label { - font: 10px/10px "Arial", sans-serif; - color: #666; - text-transform: uppercase; - } - - div#zp-ZotpressMetaBox-Tabs .wp-admin select[multiple], - div#zp-ZotpressMetaBox-Tabs div.zp-Tab select { - width: 200px; - height: 228px; - } - div#zp-ZotpressMetaBox-Tabs div.zp-Tab select#zp-ZotpressMetaBox-Collection-Items { - width: 344px; - } - - #zp-ZotpressMetaBox-Pages-Button { - display: none !important; - } - - /* Pages */ - - div#zp-ZotpressMetaBox-Pages { - margin-left: 317px; - padding: 6px; - } - div#zp-ZotpressMetaBox-Pages p.zp-Note { - margin-bottom: 0 !important; - } - - /* Zotpress Shortcode output */ - - div#zp-Zotpress-CKEditor-Output { - display: block; - padding: 7px; - padding-bottom: 0; - } - div#zp-Zotpress-CKEditor-Output label { - font-size: 10px; - text-transform: uppercase; - } - input#zp-Zotpress-Output-Citation { - width: 230px; - } - input#zp-Zotpress-Output-Shortcode { - display: none; - } \ No newline at end of file diff --git a/css/zotpress.css b/css/zotpress.css deleted file mode 100644 index 6552343..0000000 --- a/css/zotpress.css +++ /dev/null @@ -1,1667 +0,0 @@ - - - /* START OF BASIC ZOTPRESS CSS */ - - div#zp-Zotpress select { - cursor: pointer; - } - - div#zp-Zotpress div.zp-Col-1 { - float: left; - width: 350px; - } - div#zp-Zotpress div.zp-Col-2 { - float: left; - } - - #adminmenu .current .wp-menu-image img { - opacity: 1.0; - filter: alpha(opacity = 100); - } - - div#zp-Zotpress del { - color: #aaa; - text-decoration: none; - } - - div#zp-Setup h3, - div#zp-Zotpress h3 { - clear: both; - font: 400 27px/32px "Oswald", "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif; - margin: 0; - padding: 9px 15px 4px 0; - text-transform: uppercase; - } - div#zp-Zotpress h3.zp-HeaderGroup { - /*margin-bottom: -0.5em;*/ - } - div#zp-Setup h3.pair { - border-bottom: 0; - padding: 15px 30px 0; - } - - div#zp-Setup h4, - div#zp-Zotpress h4 { - font: italic 400 17px/21px "Droid Serif", "Georgia", serif; - margin: 1.5em 0 1em; - } - div#zp-Setup h4 { - font: italic 400 16px/21px "Droid Serif", "Georgia", serif; - } - div#zp-Setup h4.pair { - border-bottom: 1px solid #eee; - margin: 0; - padding: 10px 30px 25px; - } - - div#zp-Zotpress h5 { - font: 300 11px/30px "Droid Serif", serif; - margin-bottom: -15px; - text-transform: uppercase; - } - - div#zp-Zotpress hr { - border: none; - border-top: 1px solid #ddd; - clear: both; - margin: 3.3em 0 0.7em; - height: 1px; - } - div#zp-Setup hr.clear, - div#zp-Zotpress hr.clear { - border: none; - margin-bottom: 0; - } - - div#zp-Zotpress ul { - list-style: none; - margin: 20px 0 25px; - padding: 0; - } - div#zp-Zotpress ul li { - background: url('../images/sprite.png') no-repeat -40px -60px; - padding-left: 15px; - margin-left: 5px; - margin-bottom: 10px; - list-style: none; - } - - div#zp-Zotpress form hr.clear { - margin: 0; - padding: 0; - height: 1px; - } - - div#zp-Zotpress p.example { - font-family: monospace; - font-size: 1.1em; - } - - /* END OF BASIC ZOTPRESS CSS */ - - - - /* START OF SETUP CSS */ - - div#zp-Setup { - border-bottom: 1px solid #ccc; - margin-right: 1.5em; - width: auto; - min-width: 549px; - } - div#zp-Setup div#zp-Zotpress-Navigation { - z-index: 1; - position: relative; - margin-bottom: 0; - } - div.zp-Setup-Step, - div#zp-Setup-Step { - z-index: 0; - position: relative; - background-color: #fff; - padding: 1em 0 0.65em; - } - div.zp-Setup-Step.second { - border-top: 1px solid #eee; - } - div.zp-Setup-Step.second:before, - div.zp-Setup-Step.second:after { - display: table; - content: ""; - } - div.zp-Setup-Step.second:after { - clear: both; - } - - div#zp-Setup h3 { - padding: 15px 30px 25px; - border-bottom: 1px solid #eee; - } - div#zp-Setup-Step hr { - clear: both; - border: none; - padding: 0; - margin: 1em 0; - height: 1px; - background: none; - border-top: 1px solid #eee; - } - div#zp-Setup-Step hr.clear { - margin: 0; - } - - div#zp-Setup div.zp-Column-1, - div#zp-Setup div.zp-Column-2 { - float: left; - margin-left: 30px; - width: 400px; - } - - div#zp-Setup p.note { - color: #666; - font-size: 0.9em; - font-style: italic; - margin: -10px 0 10px 0; - } - - div#zp-Setup div.zp-Zotpress-Options { - margin-bottom: 2em; - } - - div#zp-Zotpress-Setup-Buttons { - clear: both; - border-top: 1px solid #eee; - } - a#zp-Setup-Cancel, - div#zp-Zotpress-Setup-Buttons a, - div#zp-Zotpress-Setup-Buttons input { - margin: 20px 30px 12px; - float: right; - } - a#zp-Setup-Cancel { - float: none; - } - div#zp-Zotpress-Setup-Buttons a#zp-Import-Accounts-Button { - margin-right: 0; - } - div#zp-Zotpress-Setup-Buttons a#zp-Import-Browse-Button { - margin-left: 10px; - } - - div#zp-Setup div.zp-Zotpress-Options div.zp-Success, - div#zp-Setup div.zp-Zotpress-Options div.zp-Loading, - div#zp-Setup div.zp-Zotpress-Options div.zp-Errors { - float: left; - height: 32px; - } - div#zp-Setup div.zp-Zotpress-Options div.zp-Success, - div#zp-Setup div.zp-Zotpress-Options div.zp-Errors { - margin-top: 14px; - margin-bottom: 0; - padding-left: 35px; - height: 24px; - } - div#zp-Setup div.zp-Zotpress-Options div.zp-Success { - background-position: 0 -82px; - } - div#zp-Setup div.zp-Zotpress-Options div.zp-Errors { - background-position: 0 -146px; - } - div#zp-Setup div.zp-Zotpress-Options div.zp-Loading { - margin-top: 6px; - } - - - div.zp-Step-Import, - div#zp-Step-Import { - padding: 10px 30px; - } - .second div.zp-Step-Import { - padding-top: 0; - } - div#zp-Zotpress-Setup-Import-Buttons { - margin-top: 2em; - } - input#zp-Zotpress-Setup-Import, - .wp-core-ui input.zp-Import-Button.button-secondary { - margin: 0 0.5em 1em 0; - float: left; - } - div#zp-Step-Import-Collection { - background-color: #f9f9f9; - clear: both; - margin-top: 1em; - width: 36.75em; - height: 13.5em; - } - div#zp-Step-Import-Collection.loading { - background: #f9f9f9 url('../images/loading_default.gif') no-repeat center; - } - div#zp-Step-Import-Collection iframe { - width: 100%; - } - #zp-Zotpress-Setup-Import-Selective { - float: left; - margin: 1em 0; - } - - - iframe.zp-Setup-Sync, - iframe#zp-Setup-Import { - position: absolute; - top: 0; - right: 0; - margin: 0; - padding: 0; - - /* LIVE */ - visibility: hidden; - width: 50px; - height: 35px; - - /* DEBUGGING */ - /*border: 3px solid #eee;*/ - /*width: 350px;*/ - /*height: 200px;*/ - } - - div.zp-Loading-Container { - clear: both; - padding-top: 0.75em; - } - div.zp-Loading-Container:before, - div.zp-Loading-Container:after { - content: ""; - display: table; - } - div.zp-Loading-Container:after { - clear: both; - } - div.zp-Loading-Container.selective { - clear: none; - padding-top: 0; - } - div.zp-Loading-Initial.zp-Loading-Import { - background: transparent url('../images/loading_import.gif') no-repeat 0 6px; - display: none; - float: left; - margin: 0; - width: 70px; - height: 20px; - } - div.zp-Loading-Initial.zp-Loading-Import.selective { - margin-top: 1.35em; - margin-left: 1em; - } - div.zp-Import-Messages { - color: #999; - font: italic 9px/20px Georgia,"Times New Roman","Bitstream Charter",Times,serif; - display: none; - float: left; - margin: 0 0 0 1em; - } - div.zp-Import-Messages.selective { - margin-top: 1.95em; - } - - - - /* START OF SETUP CHECK */ - - #zp-Setup-Check { - padding: 1.5em 30px; - } - #zp-Setup-Check-Message.error { - background: #fceae9; - } - #zp-Setup-Check-Message.updated { - background: #eef9e6; - } - div#zp-Setup-Check-Message.error strong em { - color: #E14D43; - font-style: normal; - } - div#zp-Setup-Check-Message.updated strong em { - color: #7AD03A; - font-style: normal; - } - - - - /* START OF ADD FORM CSS */ - - form#zp-Add { - padding: 0; - margin: 0; - } - *:first-child+html form#zp-Add { /* IE7 hack */ - /*width: 850px;*/ - } - form#zp-Add fieldset { - background: transparent; - border: none; - margin: 0; - padding: 0; - } - form#zp-Add div.field { - clear: both; - padding: 2.2em 2.4em; - } - - form#zp-Add label, - form#zp-Add select, - form#zp-Add textarea, - form#zp-Add input, - form#zp-Add aside { - display: block; - float: left; - } - form#zp-Add select, - form#zp-Add textarea, - form#zp-Add input { - margin: -4px 0 0; - } - form#zp-Add input#public_key { - min-width: 18em; - } - form#zp-Add label { - font: italic 400 1.1em/1.25em "Droid Serif", serif; - width: 20%; - } - form#zp-Add label.required { - background: url('../images/sprite.png') no-repeat 0 -36px; - padding-left: 15px; - margin-left: -15px; - } - form#zp-Add aside { - float: right; - margin-top: -8px; - width: 40%; - } - form#zp-Add aside p { - font-size: 0.85em; - margin: 0 0 0 1em; - } - form#zp-Add .last aside p { - padding-bottom: 2em; - } - - form#zp-Add input#upload_image, - form#zp-Add input#upload_image_button { - display: inline; - }/* Remove once converted to WP types w/ post image? */ - - #zp-Setup div.proceed { - border-top: 1px solid #eee; - clear: both; - width: 100%; - } - #zp-Setup div.proceed input#zp-Connect { - margin: 1em 2em 0.5em; - float: right; - } - /* Thanks to http://nicolasgallagher.com/micro-clearfix-hack/ */ - #zp-Setup div.proceed:before, - #zp-Setup div.proceed:after { - content: ""; - display: table; - } - #zp-Setup div.proceed:after { - clear: both; - } - - form#zp-Add div.message { - position: absolute; - bottom: 1.1em; - right: 8.5em; - width: 100%; - } - div.zp-Loading { - background: transparent url('../images/loading_default.gif') no-repeat center; - display: none; - float: right; - letter-spacing: -1000px; - overflow: hidden; - text-indent: -5000px; - margin: 0 0 0; - width: 30px; - height: 30px; - } - div.zp-Errors, - div.zp-Success { - display: none; - float: right; - font-weight: bold; - margin: 0 0 0; - padding-left: 35px; - } - div.zp-Errors { - background: url('../images/sprite.png') no-repeat 0 -139px; - color: #990033; - } - div.zp-Success { - background: url('../images/sprite.png') no-repeat 0 -76px; - color: #009966; - } - div.zp-Errors p, - div.zp-Success p { - margin: 5px 0; - } - - /* END OF SETUP CSS */ - - - - /* START OF LOADING CSS */ - - div.zp-Loading-Initial { - background: transparent url('../images/loading_initial.gif') no-repeat -3px 10px; - margin: 0; - padding: 0; - width: 220px; - height: 18px; - } - div.zp-Loading-Initial h2 { - margin-bottom: -12px; - } - iframe#zp-Loading-Initial { - visibility: hidden; - } - - /* END OF LOADING CSS */ - - - - /* START TABS */ - - div#zp-Zotpress-Navigation { - border-bottom: 1px solid #ccc; - margin: 10px 0 20px; - overflow: visible; - /*height: 47px;*/ - height: 49px; - } - - div#zp-Zotpress-Navigation h1 { - font: 600 18px/24px "Source Sans Pro", sans-serif; - float: left; - margin: 0; - padding: 0.45em 5em 1em 0; - text-transform: uppercase; - } - div#zp-Zotpress-Navigation h1 em { - color: #c23d35; - font-style: normal; - } - - /* Nav Items */ - - div#zp-Zotpress-Navigation .nav-item, - div#zp-Zotpress-Navigation :visited.nav-item { - color: #000; - display: block; - float: left; - font: 300 15px/24px "Source Sans Pro", sans-serif; - padding: 0.75em 1.5em; - outline: none; - text-transform: uppercase; - text-decoration: none; - } - div#zp-Setup:not(.zp-Step-Selective) div#zp-Zotpress-Navigation .nav-item, - div#zp-Setup:not(.zp-Step-Selective) div#zp-Zotpress-Navigation :visited.nav-item { - color: #bbb; - } - - div#zp-Zotpress-Navigation :hover.nav-item { - border-bottom: 0.25em solid #000; - } - div#zp-Setup:not(.zp-Step-Selective) div#zp-Zotpress-Navigation :hover.nav-item { - border-bottom: none; - } - - div#zp-Zotpress-Navigation :focus.nav-item, - div#zp-Zotpress-Navigation :active.nav-item, - div#zp-Zotpress-Navigation .active.nav-item { - background-color: #eaeaea; - border-bottom: 0.25em solid #000; - box-shadow: none; - } - - div#zp-Zotpress-Navigation .nav-item.nav-tab-active, - div#zp-Setup div#zp-Zotpress-Navigation .nav-item.nav-tab-active, - div#zp-Setup div#zp-Zotpress-Navigation .nav-item.nav-tab-active:hover, - div#zp-Setup div#zp-Zotpress-Navigation .nav-item.nav-tab-active:active { - border-bottom: 0.25em solid #E14D43; - background-color: transparent; - color: #000; - } - - div#zp-Zotpress-Navigation .nav-item.nav-tab-active strong { - font-weight: bold; - margin-right: 0.25em; - } - - div#zp-Icon { - background: transparent url('../images/sprite.png') no-repeat -4px -310px; - float: left; - margin-right: 1em; - width: 33px; - height: 44px; - } - - /* END TABS */ - - - - /* START BROWSE */ - - div#zp-Options-Wrapper, - div#zp-Browse-Wrapper { - position: relative; - background-color: #fff; - border-bottom: 1px solid #ccc; - margin-top: -20px; - padding: 1em 0 0; - } - div#zp-Options-Wrapper:before, - div#zp-Options-Wrapper:after { - content: ""; - display: table; - } - div#zp-Options-Wrapper:after { - clear: both; - } - div#zp-Options-Wrapper h3, - div#zp-Browse-Wrapper h3 { - padding: 15px 30px 25px; - } - div#zp-Options-Wrapper h3 { - border-bottom: 1px solid #eee; - } - - div#zp-Zotpress div#zp-Options-Wrapper hr { - border-color: #eee; - margin-bottom: 0; - } - div#zp-Zotpress div#zp-Options-Wrapper div.zp-Column-1, - div#zp-Zotpress div#zp-Options-Wrapper div.zp-Column-2 { - border-color: #eee; - margin-right: 0; - width: 49.5%; - } - div#zp-Zotpress div#zp-Options-Wrapper div.zp-Column-Inner { - padding: 0 25px; - } - - div#zp-Browse { - background-color: #F9F9F9; - margin: 0; - padding: 0; - overflow: hidden; - width: 100%; - } - div#zp-Browse-Bar { - background-color: #ACBAD5; - float: left; - padding-bottom: 5000px; - margin-bottom: -5000px; - width: 25%; - } - div#zp-Browse label, - div#zp-Browse-Accounts label { - /*font: normal 600 1em/1.5em "Open Sans", Helvetica, Arial, sans-serif;*/ - font: normal 600 1em/1.75em "Droid Serif", serif; - color: #fff; - display: block; - padding: 4% 0 0 6%; - text-transform: uppercase; - } - - - /* Accounts */ - - div#zp-Browse-Accounts { - display: inline; - } - div#zp-Browse-Accounts label { - color: #ccc; - display: none; - font: normal 400 1em/1.75em "Droid Serif", serif; - margin-right: 5px; - padding: 0; - } - div#zp-Zotpress select#zp-FilterByAccount { - font-size: inherit; - line-height: inherit; - border: none; - box-shadow: none; - margin: 0; - padding: 0; - display: inline; - height: auto; - vertical-align: baseline; - } - div#zp-Zotpress select#zp-FilterByAccount.loading { - color: #ddd; - } - - div#zp-Browse-Account-Options { - position: absolute; - top: 35px; - right: 30px; - } - .zp-Browse-Account-Import { - padding-left: 3px !important; - margin-right: 5px !important; - transition: none !important; - } - .zp-Browse-Account-Import:before { - background-image: url("../images/sprite.png") !important; - background-repeat: no-repeat !important; - background-position: -252px -420px !important; - content: ""; - display: block; - float: left; - width: 25px; - height: 25px; - } - .zp-Browse-Account-Import.loading:before { - background-image: url("../images/loading_default.gif") !important; - background-position: 2px center !important; - } - .zp-Browse-Account-Default { - padding-left: 3px !important; - transition: none !important; - } - .zp-Browse-Account-Default:before { - background-image: url("../images/sprite.png") !important; - background-repeat: no-repeat !important; - background-position: -312px -420px !important; - content: ""; - display: block; - float: left; - width: 25px; - height: 25px; - } - .zp-Browse-Account-Default.selected:before { - background-position: -282px -420px !important; - } - .zp-Browse-Account-Default.loading:before { - background-image: url("../images/loading_default.gif") !important; - background-position: 2px center !important; - } - .zp-Browse-Account-Default.success:before { - background-image: url("../images/checkmark-green.png") !important; - background-position: 3px center !important; - } - - - /* Collection Folders */ - - div#zp-Browse-Collections { - background-color: #ACBAD5; - width: 100%; - } - - div#zp-Browse-Collections a.zp-List-Subcollection, - div#zp-Browse-Collections a.zp-List-Subcollection:visited - { - background-color: #7c8798; - border-bottom: 1px solid #687384; - color: #fff; - display: block; - font-size: 9pt; - line-height: 1.1; - padding: 4% 6% 4.5%; - outline: none; - text-decoration: none; - } - div#zp-Browse-Collections a.zp-List-Subcollection:hover - { - background-color: #9aa3af; - } - div#zp-Browse-Collections a.zp-List-Subcollection.selected, - div#zp-Browse-Collections a.zp-List-Subcollection.down, - div#zp-Browse-Collections a.zp-List-Subcollection:active, - div#zp-Browse-Collections a.zp-List-Subcollection:focus - { - background-color: #6d798b; - box-shadow: none; - color: #9aa3af; - } - div#zp-Browse-Collections a.zp-List-Subcollection span.name { - display: block; - font-weight: 600; - padding-bottom: 4%; - } - - - div#zp-Browse-Collections a.zp-List-Subcollection.toplevel, - div#zp-Browse-Collections a.zp-List-Subcollection.toplevel.selected { - background-color: #ACBAD5; - color: #fff; - font: normal 600 1em/1.75em "Droid Serif", serif; - padding: 3% 6%; - text-transform: uppercase; - } - div#zp-Browse-Collections a.zp-List-Subcollection.toplevel span, - div#zp-Browse-Collections a.zp-List-Subcollection.toplevel.down span, - div#zp-Browse-Collections a.zp-List-Subcollection.toplevel.down:hover span, - div#zp-Browse-Collections a.zp-List-Subcollection.toplevel:active span, - div#zp-Browse-Collections a.zp-List-Subcollection.toplevel.selected span, - div#zp-Browse-Collections a.zp-List-Subcollection.toplevel.selected:hover span { - background: transparent url('../images/sprite.png') no-repeat -250px -558px; - padding-left: 24px; - } - - div#zp-Browse-Collections a.zp-List-Subcollection.child span.name, - div#zp-Browse-Collections a.zp-List-Subcollection.child:active span.name, - div#zp-Browse-Collections a.zp-List-Subcollection.child:hover span.name { - background: transparent url('../images/sprite.png') no-repeat 0 -730px; - padding-left: 10px; - } - div#zp-Browse-Collections a.zp-List-Subcollection.child.down span.name, - div#zp-Browse-Collections a.zp-List-Subcollection.child.down:hover span.name { - background: transparent url('../images/sprite.png') no-repeat -490px -730px; - padding-left: 10px; - } - div#zp-Browse-Collections a.zp-List-Subcollection.child span.item_key, - div#zp-Browse-Collections a.zp-List-Subcollection.child span.meta { - padding-left: 10px; - } - - div#zp-Browse-Collections a.zp-List-Subcollection span.item_key, - div#zp-Browse-Collections a.zp-List-Subcollection span.meta { - display: block; - font-size: 0.75em; - text-transform: uppercase; - } - div#zp-Browse-Collections a.zp-List-Subcollection span.item_key { - padding-bottom: 3px; - } - - div#zp-Browse-Collections a.zp-List-Subcollection.back span, - div#zp-Browse-Collections a.zp-List-Subcollection.back:hover span { - background: transparent url('../images/sprite.png') no-repeat 0 -812px; - padding-left: 15px; - } - div#zp-Browse-Collections a.zp-List-Subcollection.back:active span, - div#zp-Browse-Collections a.zp-List-Subcollection.back.down span, - div#zp-Browse-Collections a.zp-List-Subcollection.back.down:hover span { - background: transparent url('../images/sprite.png') no-repeat -490px -812px; - padding-left: 15px; - } - - div#zp-Browse-Collections a.zp-List-Subcollection.last { - border-bottom: none; - } - - div.zp-Collection-Title { - background-color: #fff; - border-bottom: 1px solid #eee; - color: #444; - font: normal 400 1em/1.75em "Droid Serif", serif; - padding: 0.9% 2%; - padding-right: 15px; - text-transform: uppercase; - } - div.zp-Collection-Title .item_key { - float: right; - color: #ccc; - } - div.zp-Collection-Title .item_key_inner { - float: right; - } - div.zp-Collection-Title .item_key_inner input, - div.zp-Collection-Title .item_key_inner span { - color: #444; - cursor: pointer; - display: block; - float: right; - text-align: right; - width: 6em; - } - div.zp-Collection-Title .item_key_inner input { - background: none; - border: none; - display: none; - font: normal 400 1em/1em "Droid Serif", serif; - margin: 0; - padding: 0; - } - div.zp-Collection-Title .item_key_inner input:focus { - border: none; - box-shadow: none; - margin-top: 0.3em; - } - - /* Browse Tags */ - - div#zp-Browse-Tags { - background-color: #ACBAD5; - border-top: 1px solid #687384; - padding: 0.05em 0 5%; - width: 100%; - } - div#zp-Browse-Tags:before, - div#zp-Browse-Tags:after { - content: ""; - display: table; - } - div#zp-Browse-Tags:after { - clear: both; - } - div#zp-Browse-Tags label span { - background: transparent url('../images/sprite.png') no-repeat -483px -556px; - padding-left: 22px; - } - select#zp-List-Tags { - background: #99abcc; - border: none; - border: 1px solid #8798b4; - box-shadow: 0 1px 2px #8798b4 inset; - color: #fff; - font-size: 0.9em; - margin: 4% 6%; - width: 88%; - } - select#zp-List-Tags.active { - background-color: #fff; - color: #7988a2; - } - select#zp-List-Tags:focus { - border: 1px solid #8798b4; - box-shadow: none; - } - select#zp-List-Tags:focus { - background: #8397b8; - border-color: #7185a6; - color: #fff; - } - select#zp-List-Tags option { - background: #fff; - border-bottom: 1px solid #eee; - color: #666; - padding: 0.5em 1em; - } - - - /* Pagination */ - - div#zp-Zotpress div#zp-Pagination { - position: relative; - background-color: #fff; - /*border-top: 1px solid #eee;*/ - clear: both; - min-height: 3em; - } - div#zp-Pagination span { - display: block; - font-size: 12px; - font-family: "Droid Serif", serif; - padding: 1em; - text-align: right; - text-shadow: 0 1px 0 #FAFAFA; - } - - /* END BROWSE */ - - - - /* START CITATION LISTS */ - - div#zp-Zotpress div#zp-List { - float: right; - border-top: 1px solid #E5E5E5; - border-bottom: 1px solid #eee; - width: 75%; - } - - div#zp-Zotpress div#zp-List h3 { - display: block; - color: #bbb; - background: #333; - font: 400 19px/24px "Oswald","Times New Roman","Bitstream Charter",Times,serif; - margin: -3px 0 0; - padding: 10px 15px; - } - div#zp-Zotpress div#zp-List h3 em { - color: #fff; - font-style: normal; - } - - div#zp-Zotpress div#zp-List p { - margin: 1em; - } - - div#zp-Zotpress div#zp-List a, - div#zp-Zotpress div#zp-List a:visited - { - color: #E14D43; /* bae1fe */ - text-decoration: none; - } - div#zp-Zotpress div#zp-List h3 a { - float: right; - } - div#zp-Zotpress div#zp-List a:hover { - color: #fff; - } - div#zp-Zotpress div#zp-List a:active { - color: #999; - } - - /* END CITATION LISTS */ - - - - /* START CITATIONS */ - - div#zp-Zotpress div#zp-List div.zp-Entry { - background-color: #fff; - padding: 15px; - } - div#zp-Zotpress div#zp-List div.zp-Entry:before, - div#zp-Zotpress div#zp-List div.zp-Entry:after { - content: ""; - display: table; - } - div#zp-Zotpress div#zp-List div.zp-Entry:after { - clear: both; - } - div#zp-Zotpress div#zp-List div.zp-Entry.odd { - background-color: transparent; - } - - div#zp-Zotpress div#zp-List div.zp-Entry-Image { - position: relative; - float: right; - margin-left: 15px; - overflow: hidden; - text-align: center; - width: 100px; - height: 100px; - } - - div#zp-Zotpress div#zp-List div.zp-Entry-Image a.upload, - div#zp-Zotpress div#zp-List div.zp-Entry-Image a.upload:link, - div#zp-Zotpress div#zp-List div.zp-Entry-Image a.upload:visited, - div#zp-Zotpress div#zp-List div.zp-Entry-Image a.upload:active - { - z-index: 2; - top: 0; - left: 0; - position: absolute; - background-color: #F6F6F6; - border: 2px dashed #eee; - color: #ccc; - display: block; - font-size: 0.9em; - font-weight: bold; - line-height: 96px; - text-decoration: none; - width: 96px; - height: 96px; - } - div#zp-Zotpress div#zp-List div.zp-Entry-Image.hasimage a.upload { - background: transparent; - border: none; - color: #fff; - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -moz-opacity: 0; - -khtml-opacity: 0; - text-shadow: 0px 0px 3px rgba(0, 0, 0, 1.0); - width: 100px; - height: 100px; - } - div#zp-Zotpress div#zp-List div.zp-Entry-Image a.upload:hover { - background-color: #a8cf30; - border: 2px solid #a8cf30; - color: #fff; - } - div#zp-Zotpress div#zp-List div.zp-Entry-Image.hasimage a.upload:hover { - background: transparent; - border: none; - opacity: 1; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; - filter: alpha(opacity=100); - -moz-opacity: 1; - -khtml-opacity: 1; - width: 100px; - height: 100px; - } - div#zp-Zotpress div#zp-List div.zp-Entry-Image a.delete { - position: absolute; - z-index: 3; - top: 0; - right: 0; - left: auto; - border: none; - background-color: #E14D43; - color: #fff; - display: none; - font-size: 14pt; - font-weight: bold; - line-height: 25px; - text-align: center; - width: 25px; - height: 25px; - } - div#zp-Zotpress div#zp-List div.zp-Entry-Image.hover.hasimage a.delete { - display: block; - } - - div#zp-Zotpress div#zp-List div.zp-Entry-Image img { - z-index: 1; - position: absolute; - top: 0; - left: 0; - width: 100px; - height: 100px; - } - - div#zp-Zotpress div.zp-Entry div.csl-bib-body { - font-size: 0.9em; - margin: 0 0 15px; - } - - div#zp-Zotpress div.zp-Entry div.zp-Entry-ID { - /*border-top: 1px dashed #EEEEEE;*/ - color: #999; - font-size: 10px; - display: block; - margin: 0; - } - div#zp-Zotpress div.zp-Entry div.zp-Entry-ID span.title { - /*color: #ccc;*/ - text-transform: uppercase; - } - div#zp-Zotpress div.zp-Entry div.zp-Entry-ID div { - display: inline-block; - } - div#zp-Zotpress div.zp-Entry div.zp-Entry-ID-Text span { - cursor: pointer; - } - div#zp-Zotpress div.zp-Entry div.zp-Entry-ID input { - border: 0; - background: transparent; - color: #999; - display: none; - font-size: 10px; - padding: 0; - margin: 0; - } - - /* END CITATIONS */ - - - - /* START IMAGE FORM */ - - div#zp-Zotpress form#zp-Image { - -moz-border-radius: 10px; - background-color: #fafafa; - margin: 0.75em 0 30px 0; - width: 780px; - } - - div#zp-Zotpress form#zp-Image fieldset { - padding: 10px 20px; - } - - div#zp-Zotpress form#zp-Image div.section { - margin: 10px 0; - } - - div#zp-Zotpress form#zp-Image div.zp-Image-Current { - float: right; - overflow: hidden; - margin: 20px; - max-width: 310px; - max-height: 310px; - } - - div#zp-Zotpress div.zp-Citation { - width: 780px; - } - div#zp-Zotpress div.zp-Citation div.csl-bib-body { - margin: 0; - } - div#zp-Zotpress div.zp-Citation div.zp-Entry { - min-height: 0; - } - - div#zp-Zotpress form#zp-Image span.help { - color: #999; - font: italic 11px/14px 'Georgia', serif; - } - - div#zp-Zotpress form#zp-Image #zp-Submit, - div#zp-Zotpress form#zp-Image #zp-Cancel { - float: left; - } - div#zp-Zotpress form#zp-Image #zp-Submit { - margin-right: 4px; - } - - div#zp-Zotpress form#zp-Image div.zp-Loading { - display: none; - float: left; - margin: 0 0 0 4px; - } - - div#zp-Zotpress form#zp-Image div.zp-Errors, - div#zp-Zotpress form#zp-Image div.zp-Success { - margin-left: 140px; - padding-left: 35px; - } - div#zp-Zotpress form#zp-Image div.zp-Errors p, - div#zp-Zotpress form#zp-Image div.zp-Success p { - padding: 6px 0 1px; - } - - /* END IMAGE FORM */ - - - - /* START OF HIDDEN URL CSS */ - - span#ZOTPRESS_PLUGIN_URL { - display: none; - } - - /* END OF HIDDEN URL CSS */ - - - - /* START ACCOUNTS */ - - div#zp-ManageAccounts { - clear: both; - } - div#zp-ManageAccounts h3 { - width: 50%; - } - - a.zp-AddAccountButton, - a.zp-AddAccountButton:link, - a.zp-AddAccountButton:visited, - a.zp-AddAccountButton:active, - a.zp-AddAccountButton:hover { - float: right; - margin-top: -2.55em; - text-shadow: none; - } - a.zp-AddAccountButton span { - background: transparent url('../images/sprite.png') no-repeat 0 -351px; - padding: 0 2px 0 16px; - } - a.zp-AddAccountButton:hover { - background: #ceec8a; - } - a.zp-AddAccountButton:hover span { - background-position: -161px -351px; - } - a.zp-AddAccountButton:active { - background: #777; - color: #000; - } - a.zp-AddAccountButton:active span { - background-position: -161px -350px; - } - - #zp-Accounts { - margin: 1.55em 0; - } - - #zp-Accounts th { - font: 300 1.1em/1.1em "Droid Serif", sans-serif; - } - - #zp-Accounts .account_type { - width: 3em; - } - #zp-Accounts .api_user_id { - width: 4em; - } - #zp-Accounts .public_key { - width: 13.5em; - } - #zp-Accounts .status { - text-align: center; - width: 5em; - } - #zp-Accounts .status .status_good { - color: #008000; - font-weight: bold; - } - #zp-Accounts .status .status_bad { - color: #DD3D36; - font-weight: bold; - } - #zp-Accounts .actions { - width: 22.5em; - } - - #zp-AccountsList .default a, - #zp-AccountsList .actions a { - display: block; - float: left; - outline: none; - margin: 0 1.25em 0 0; - height: 25px; - } - #zp-AccountsList .default a:focus, - #zp-AccountsList .actions a:focus { - box-shadow: none; - } - @media only screen and (max-width: 1200px) - { - #zp-AccountsList .default a, - #zp-AccountsList .actions a { - margin-right: 0.25em; - width: 25px; - height: 25px; - overflow: hidden; - } - #zp-Accounts th.default { - width: 50px; - } - #zp-Accounts .actions { - width: 94px; - } - } - #zp-AccountsList .default a:before, - #zp-AccountsList .actions a:before { - background-image: url('../images/sprite.png'); - background-repeat: no-repeat; - padding: 0.15em 0 0.15em 2em; - vertical-align: middle; - - content: ""; - width: 25px; - height: 25px; - } - #zp-AccountsList .default a:hover:before, - #zp-AccountsList .actions a:hover:before { - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; - filter: alpha(opacity=50); - -moz-opacity: 0.5; - -khtml-opacity: 0.5; - opacity: 0.5; - } - #zp-AccountsList .actions a.sync span.icon { - background-position: -31px -422px; - } - #zp-AccountsList .actions a.sync.syncing span.icon { - background: transparent url('../images/syncing.gif') no-repeat 0 0; - } - #zp-AccountsList .actions a.sync.error span.icon { - background-position: -51px -422px; - } - #zp-AccountsList .actions a.sync.success span.icon { - background-position: -61px -422px; - } - #zp-AccountsList .actions a.selective:before { - background-position: -252px -423px; - } - #zp-AccountsList .actions a.import:before { - background-position: 0 -423px; - } - #zp-AccountsList .actions a.delete:before { - background-position: -105px 0; - } - #zp-AccountsList .actions a.delete { - margin-right: 0; - } - - #zp-AccountsList .default a.default { - float: none; - margin: 0 auto; - } - #zp-AccountsList .default.selected a.default:before { - background-position: -282px -423px !important; - } - #zp-AccountsList .default a.default:before { - background-position: -312px -423px !important; - } - #zp-AccountsList .default a.default.loading:before { - background-position: 2px center !important; - background-image: url('../images/loading_default.gif'); - background-repeat: no-repeat; - } - #zp-AccountsList .default a.default.success:before { - background-position: 2px center !important; - background-image: url('../images/checkmark-green.png'); - background-repeat: no-repeat; - } - - /* END ACCOUNTS */ - - - - - - - /* START OF MODAL CSS */ - - .zp-Modal #adminmenu, - .zp-Modal #footer, - .zp-Modal #wphead - { - display: none; - } - .zp-Modal #wpbody { - margin-left: 25px; - } - body.wp-admin.zp-Modal { - min-width: 400px; - } - - /* END OF MODAL CSS */ - - - - /* START OF DOCUMENTATION CSS */ - - div#zp-Intext-Example { - background-color: #fff; - -moz-box-shadow: 0 0 1px #aaa; - -webkit-box-shadow: 0 0 1px#aaa; - box-shadow: 0 0 1px #aaa; - float: right; - font: normal 400 12px/18px "Droid Serif","Georgia",serif; - margin: 1em 0 0 2em; - padding: 2em; - width: 24%; - } - div#zp-Intext-Example .title { - font-weight: 600; - font-style: italic; - } - - div#zp-Zotpress code { - background: #ddd; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - font-family: "Monaco", monospace; - padding: 2px 3px; - } - - .zp-Documentation { - border: none; - background-color: #fff; - margin: 2em 0; - padding: 0; - } - - .zp-Documentation strong { - font-weight: bold; - } - div#zp-Zotpress .zp-Documentation code { - background: #eaeaea; - } - - .zp-Documentation tr, - .zp-Documentation th, - .zp-Documentation td { - border: none; - font-weight: 300; - margin: 0; - padding: 8px 16px; - text-align: left; - vertical-align: top; - } - .zp-Documentation td { - border-bottom: 1px solid #f1f1f1; - padding: 12px 16px; - } - .zp-Documentation .zebra td { - background-color: #f9f9f9; - border-bottom: 1px solid #eee; - } - .zp-Documentation p { - margin: 0; - } - - .zp-Documentation .main { - background-color: #333; - border-bottom: none; - color: #fff; - font: 400 1.5em/1.5em "Oswald", sans-serif; - text-transform: uppercase; - } - - .zp-Documentation .category, - .zp-Documentation .type { - /*font: 400 1.25em/1.25em "Source Sans Pro", sans-serif;*/ - font: 600 1em/1.25em "Source Sans Pro", sans-serif; - text-transform: uppercase; - } - - .zp-Documentation .category, - .zp-Documentation .zebra .category { - background-color: #666; - border-bottom: 1px solid #999; - color: #fff; - } - - .zp-Documentation .type { - background-color: #ACBAD5; - border-bottom: 1px solid #859ac2; - } - .zp-Documentation .zebra .type { - background-color: #99abcc; - border-bottom: 1px solid #859ac2; - } - - .zp-Documentation .code { - background-color: #ffcb15; - border-bottom: 1px solid #f9a93e; - } - .zp-Documentation .zebra .code { - background-color: #ffb915; - border-bottom: 1px solid #f2aa00; - } - .zp-Documentation .example { - min-width: 20em; - padding-right: 0; - } - .zp-Documentation .example p { - margin-bottom: 0.25em; - } - - .zp-Documentation p.break { - margin-top: 1em; - } - - /*.zp-Documentation tr.last td,*/ - .zp-Documentation td.last { - border-bottom: none; - } - - /* END OF DOCUMENTATION CSS */ - - - - /* START OF MESSAGE CSS */ - - div.zp-Message { - background-color: #ffcb15; - display: block; - float: right; - margin-left: 20px; - margin-top: -30px; - overflow: hidden; - width: 275px; - } - div#zp-Zotpress div.zp-Message h3 { - font-size: 21px; - line-height: 1.4em; - padding: 1.2em; - padding-bottom: 0; - } - div.zp-Message p { - font: italic 400 14px/21px "Droid Serif", "Georgia", serif; - margin: 0; - padding: 2em; - } - div.zp-Message p.rate { - background-color: #333; - color: #fff; - text-shadow: 0 1px 0 #000; - } - div.zp-Message p.version { - color: #333; - font-size: 0.9em; - padding-top: 1em; - } - div.zp-Message p.version a, - div.zp-Message p.version a:visited, - div.zp-Message p.version a:active { - color: #666; - } - div.zp-Message p.version a:hover { - color: #999; - } - div.zp-Message p.version strong { - font: 600 11px/1em "Source Sans Pro","HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif; - text-transform: uppercase; - } - a.zp-FiveStar { - background: transparent url('../images/sprite.png') no-repeat -160px -1px; - color: #ffd900; - padding-left: 95px; - } - - ol.zp-WaysToUseZotpress { - list-style: none; - margin: 2em; - } - ol.zp-WaysToUseZotpress li { - background: transparent url('../images/sprite.png') no-repeat -300px 2px; - list-style-position: inside; - padding-left: 5px; - margin-bottom: 12px; - } - ol.zp-WaysToUseZotpress li span.number { - float: left; - font-size: 10px; - margin-left: 1px; - margin-top: 3px; - margin-right: 14px; - } - ol.zp-WaysToUseZotpress li strong { - font: 600 1em/1em "Source Sans Pro","HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif; - text-transform: uppercase; - } - ol.zp-WaysToUseZotpress li p.indent { - margin-top: -12px; - margin-bottom: 14px; - text-indent: 21px; - } - - /* END OF MESSAGE CSS */ - - - - /* START OF OPTIONS PAGE CSS */ - - div.zp-Zotpress-Options { - border-left: 0.35em solid #000; - margin: 20px 0 30px; - padding: 0.6em 1em; - } - div.zp-Zotpress-Options:before, - div.zp-Zotpress-Options:after { - content: ""; - display: table; - } - div.zp-Zotpress-Options:after { - clear: both; - } - - div#zp-Zotpress div.zp-Column-1 { - border-right: 1px solid #ddd; - float: left; - margin-right: 4%; - width: 47.5% - } - div#zp-Zotpress div.zp-Column-2 { - float: left; - width: 47.5% - } - - div.zp-Zotpress-Options label { - font: 300 0.9em/1em "Droid Serif", sans-serif; - margin: 0 0 0.5em 0; - text-transform: uppercase; - } - - div.zp-Zotpress-Options label, - div.zp-Zotpress-Options select { - display: block; - } - div.zp-Zotpress-Options select { - margin-bottom: 0.5em; - } - - div.zp-Zotpress-Options input.button-secondary { - float: left; - margin-top: 10px; - } - - div#zp-Zotpress div.zp-Zotpress-Options div.zp-Loading { - display: none; - float: left; - margin: 0.6em 0 0 0.25em; - } - div#zp-Zotpress div.zp-Zotpress-Options div.zp-Success, - div#zp-Zotpress div.zp-Zotpress-Options div.zp-Errors { - margin: 0.6em 0 0; - padding: 6px 0 4px 32px; - float: left; - } - - div#zp-Zotpress-Options-Style-New-Container { - display: none; - margin: 1.5em 0 0.5em; - } - select#zp-Zotpress-Options-Style option#new { - border-top: 1px dotted #CCCCCC; - font-weight: bold; - font-style: italic; - } - - div#zp-Zotpress .zp-Column-1 p.note { - /*margin-right: 1em;*/ - } - - div#zp-Zotpress-Options-Reset { - border-left: 0; - padding: 0; - } - - div.zp-CPT-Checkbox { - float: left; - width: 50%; - } - div.zp-Zotpress-Options div.zp-CPT-Checkbox label { - display: inline; - line-height: 2em; - vertical-align: 0.05em; - } - div.zp-Zotpress-Options div.zp-CPT-Checkbox label.dis { - color: #ccc; - } - - /* END OF OPTIONS PAGE CSS */ - - - .ui-tooltip-tipsy .ui-tooltip-titlebar, .ui-tooltip-tipsy .ui-tooltip-content { - font-weight: normal !important; - width: 300px !important; - } - \ No newline at end of file diff --git a/css/zotpress.help.css b/css/zotpress.help.css new file mode 100644 index 0000000..fd2048a --- /dev/null +++ b/css/zotpress.help.css @@ -0,0 +1,325 @@ + +/* START OF HELP CSS */ + +div#zp-Zotero-API { + background-color: #fff; +} + +div#zp-Zotpress ul#zp-Zotero-API-Menu { + background-color: #26292c; + display: block; + margin: 3em 0 0; +} +div#zp-Zotpress ul#zp-Zotero-API-Menu:before, +div#zp-Zotpress ul#zp-Zotero-API-Menu:after { + content: ""; + display: table; +} +div#zp-Zotpress ul#zp-Zotero-API-Menu:after { + clear: both; +} + +div#zp-Zotpress ul#zp-Zotero-API-Menu li { + background: none; + display: block; + float: left; + margin: 0; + padding: 0; +} +div#zp-Zotpress ul#zp-Zotero-API-Menu li a { + color: #fff; + display: block; + font: normal 1em/2.15em "Helvetica", "Arial", sans-serif; + padding: 1em 2em; + text-transform: uppercase; + text-decoration: none; +} + +div#zp-Zotpress ul#zp-Zotero-API-Menu li.ui-tabs-active { + background-color: #e14d43; +} +div#zp-Zotpress ul#zp-Zotero-API-Menu li a:focus { + box-shadow: none; +} + + +div.zp-Zotero-API-Explanation { + background: #fff; + padding: 1em 2em 1em; +} +div.zp-Zotero-API-Explanation:after { + clear: both; + content: ""; + display: table; +} + + +div.zp-Zotero-API-Attributes { + background-color: #e3e3e3; + padding: 1px 5px; +} +div.zp-Zotero-API-Attributes-Search { + background-color: transparent; + margin: 5px 0; +} +div.zp-Zotero-API-Attributes-Search:after { + content: ""; + display: table; + clear: both; +} +input[type="text"].zp-Zotero-API-Attributes-Search-Input { + background-color: #fff; + border: 0; + border-radius: 0; + box-shadow: none; + color: #e14d43; + float: left; + font-size: 26px; /* 2em 14px */ + font-weight: bold; + margin: 0; + padding: 14px 1em; + width: 92.5%; +} +input[type="text"].zp-Zotero-API-Attributes-Search-Input::placeholder { + color: #aaa; + font-weight: normal; + font-style: italic; +} +div.zp-Zotero-API-Attributes-Search-Status { + background: #fff; + float: left; + padding: 10px 0 11px; + width: 7.5%; +} +div.zp-Zotero-API-Attributes-Search-Status .zp-Loading, +div.zp-Zotero-API-Attributes-Search-Status .dashicons { + font-size: 30px; + float: right; + line-height: 2.1; + width: 2.1em; + height: 1.96em; +} +div.zp-Zotero-API-Attribute { + border-bottom: 1px solid #eee; + background-color: #fff; + margin: 5px 0; + padding: 2em; +} +div#zp-Zotpress div.zp-Zotero-API-Attribute h4 { + font: 600 1em/1em "Helvetica", Arial, sans-serif; + margin-top: 0.5em; + text-transform: uppercase; +} +div#zp-Zotpress div.zp-Zotero-API-Attribute h4 strong { + text-transform: lowercase; + font-size: 2em; +} + +/* END OF HELP CSS */ + + + + +/* START OF MESSAGE CSS */ + +div.zp-Message { + /*background-color: #ffcb15;*/ + background-color: #e14d43; + display: block; + float: right; + margin-left: 20px; + margin-top: -30px; + overflow: hidden; + width: 278px; +} +div#zp-Zotpress div.zp-Message h3 { + color: #fff; + font-size: 21px; + line-height: 1.4em; + padding: 1.2em; + padding-bottom: 0; +} +div.zp-Message p { + color: #fff; + font: italic 400 14px/21px "Georgia", serif; + margin: 0; + padding: 2em; +} +div.zp-Message p.rate { + background-color: #26292c; + text-shadow: 0 1px 0 #000; +} +div.zp-Message p.version { + font-size: 1em; + padding-top: 1em; +} +div.zp-Message p.version a, +div.zp-Message p.version a:visited, +div.zp-Message p.version a:active { + color: #fff; +} +div.zp-Message p.version a:hover { + color: #fff; +} +div.zp-Message p.version a#zp-Donate { + background: transparent url('../images/pp.png') no-repeat right center; + padding-right: 16px; +} +div.zp-Message p.version strong { + color: #fff; + font: 600 10px/1em "Helvetica", Arial, sans-serif; + text-transform: uppercase; +} +a.zp-FiveStar { + background: transparent url('../images/sprite.png') no-repeat -160px -1px; + color: #ffd900; + padding-left: 95px; +} + +/* END OF MESSAGE CSS */ + + + +/* START OF DOCUMENTATION CSS */ + +div#zp-InText-Example { + background-color: #fff; + -moz-box-shadow: 0 0 1px #aaa; + -webkit-box-shadow: 0 0 1px#aaa; + box-shadow: 0 0 1px #aaa; + display: flex; + flex-wrap: wrap; + justify-content: space-evenly; + align-items: stretch; + float: right; + font: normal 400 12px/18px "Georgia", serif; + margin: 0.5em; + padding: 0.5em; + width: 50%; +} +div#zp-InText-Example:after { + clear: both; + content: ""; + display: table; +} +div.zp-InText-Example-Col { + padding: 0 2%; + width: calc(45.5% - 4px); +} +div.zp-InText-Example-Col:nth-child(1) { + margin-right: 1.5%; +} +div.zp-InText-Example-Col.alt { + background-color: #f3f3f3; +} +div#zp-Zotpress div.zp-InText-Example-Col h4 { + font-size: 1.25em; + margin: 0; + padding: 1em 0 0; +} +div#zp-InText-Example .title { + font-weight: 600; + font-style: italic; +} + +div#zp-Zotpress code { + background: #ddd; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + font-family: "Monaco", monospace; + padding: 2px 3px; +} + +.zp-Documentation { + border: none; + background-color: #fff; + margin: 2em 0; + padding: 0; +} + +.zp-Documentation strong { + font-weight: bold; +} +div#zp-Zotpress .zp-Documentation code { + background: #eaeaea; +} + +.zp-Documentation tr, +.zp-Documentation th, +.zp-Documentation td { + border: none; + font-weight: 300; + margin: 0; + padding: 8px 16px; + text-align: left; + vertical-align: top; +} +.zp-Documentation td { + border-bottom: 1px solid #f1f1f1; + padding: 12px 16px; +} +.zp-Documentation .zebra td { + background-color: #f9f9f9; + border-bottom: 1px solid #eee; +} +.zp-Documentation p { + margin: 0; +} + +.zp-Documentation .main { + background-color: #333; + border-bottom: none; + color: #fff; + font: 400 1.5em/1.5em "Helvetica", "Helvetica Neue", "Arial", sans-serif; + text-transform: uppercase; +} + +.zp-Documentation .category, +.zp-Documentation .type { + font: 600 1em/1.25em "Helvetica", Arial, sans-serif; + text-transform: uppercase; +} + +.zp-Documentation .category, +.zp-Documentation .zebra .category { + background-color: #666; + border-bottom: 1px solid #999; + color: #fff; +} + +.zp-Documentation .type { + background-color: #ACBAD5; + border-bottom: 1px solid #859ac2; +} +.zp-Documentation .zebra .type { + background-color: #99abcc; + border-bottom: 1px solid #859ac2; +} + +.zp-Documentation .code { + background-color: #ffcb15; + border-bottom: 1px solid #f9a93e; +} +.zp-Documentation .zebra .code { + background-color: #ffb915; + border-bottom: 1px solid #f2aa00; +} +.zp-Documentation .example { + min-width: 20em; + padding-right: 0; +} +.zp-Documentation .example p { + margin-bottom: 0.25em; +} + +.zp-Documentation p.break { + margin-top: 1em; +} + +/*.zp-Documentation tr.last td,*/ +.zp-Documentation td.last { + border-bottom: none; +} + +/* END OF DOCUMENTATION CSS */ diff --git a/css/zotpress.help.min.css b/css/zotpress.help.min.css new file mode 100644 index 0000000..699dec5 --- /dev/null +++ b/css/zotpress.help.min.css @@ -0,0 +1 @@ +div#zp-Zotero-API{background-color:#fff}div#zp-Zotpress ul#zp-Zotero-API-Menu{background-color:#26292c;display:block;margin:3em 0 0}div#zp-Zotpress ul#zp-Zotero-API-Menu:after,div#zp-Zotpress ul#zp-Zotero-API-Menu:before{content:"";display:table}div#zp-Zotpress ul#zp-Zotero-API-Menu:after{clear:both}div#zp-Zotpress ul#zp-Zotero-API-Menu li{background:0 0;display:block;float:left;margin:0;padding:0}div#zp-Zotpress ul#zp-Zotero-API-Menu li a{color:#fff;display:block;font:normal 1em/2.15em Helvetica,Arial,sans-serif;padding:1em 2em;text-transform:uppercase;text-decoration:none}div#zp-Zotpress ul#zp-Zotero-API-Menu li.ui-tabs-active{background-color:#e14d43}div#zp-Zotpress ul#zp-Zotero-API-Menu li a:focus{box-shadow:none}div.zp-Zotero-API-Explanation{background:#fff;padding:1em 2em 1em}div.zp-Zotero-API-Explanation:after{clear:both;content:"";display:table}div.zp-Zotero-API-Attributes{background-color:#e3e3e3;padding:1px 5px}div.zp-Zotero-API-Attributes-Search{background-color:transparent;margin:5px 0}div.zp-Zotero-API-Attributes-Search:after{content:"";display:table;clear:both}input[type=text].zp-Zotero-API-Attributes-Search-Input{background-color:#fff;border:0;border-radius:0;box-shadow:none;color:#e14d43;float:left;font-size:26px;font-weight:700;margin:0;padding:14px 1em;width:92.5%}input[type=text].zp-Zotero-API-Attributes-Search-Input::placeholder{color:#aaa;font-weight:400;font-style:italic}div.zp-Zotero-API-Attributes-Search-Status{background:#fff;float:left;padding:10px 0 11px;width:7.5%}div.zp-Zotero-API-Attributes-Search-Status .dashicons,div.zp-Zotero-API-Attributes-Search-Status .zp-Loading{font-size:30px;float:right;line-height:2.1;width:2.1em;height:1.96em}div.zp-Zotero-API-Attribute{border-bottom:1px solid #eee;background-color:#fff;margin:5px 0;padding:2em}div#zp-Zotpress div.zp-Zotero-API-Attribute h4{font:600 1em/1em Helvetica,Arial,sans-serif;margin-top:.5em;text-transform:uppercase}div#zp-Zotpress div.zp-Zotero-API-Attribute h4 strong{text-transform:lowercase;font-size:2em}div.zp-Message{background-color:#e14d43;display:block;float:right;margin-left:20px;margin-top:-30px;overflow:hidden;width:278px}div#zp-Zotpress div.zp-Message h3{color:#fff;font-size:21px;line-height:1.4em;padding:1.2em;padding-bottom:0}div.zp-Message p{color:#fff;font:italic 400 14px/21px Georgia,serif;margin:0;padding:2em}div.zp-Message p.rate{background-color:#26292c;text-shadow:0 1px 0 #000}div.zp-Message p.version{font-size:1em;padding-top:1em}div.zp-Message p.version a,div.zp-Message p.version a:active,div.zp-Message p.version a:visited{color:#fff}div.zp-Message p.version a:hover{color:#fff}div.zp-Message p.version a#zp-Donate{background:transparent url(../images/pp.png) no-repeat right center;padding-right:16px}div.zp-Message p.version strong{color:#fff;font:600 10px/1em Helvetica,Arial,sans-serif;text-transform:uppercase}a.zp-FiveStar{background:transparent url(../images/sprite.png) no-repeat -160px -1px;color:#ffd900;padding-left:95px}div#zp-InText-Example{background-color:#fff;-moz-box-shadow:0 0 1px #aaa;-webkit-box-shadow:0 0 1px#aaa;box-shadow:0 0 1px #aaa;display:flex;flex-wrap:wrap;justify-content:space-evenly;align-items:stretch;float:right;font:normal 400 12px/18px Georgia,serif;margin:.5em;padding:.5em;width:50%}div#zp-InText-Example:after{clear:both;content:"";display:table}div.zp-InText-Example-Col{padding:0 2%;width:calc(45.5% - 4px)}div.zp-InText-Example-Col:nth-child(1){margin-right:1.5%}div.zp-InText-Example-Col.alt{background-color:#f3f3f3}div#zp-Zotpress div.zp-InText-Example-Col h4{font-size:1.25em;margin:0;padding:1em 0 0}div#zp-InText-Example .title{font-weight:600;font-style:italic}div#zp-Zotpress code{background:#ddd;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;font-family:Monaco,monospace;padding:2px 3px}.zp-Documentation{border:none;background-color:#fff;margin:2em 0;padding:0}.zp-Documentation strong{font-weight:700}div#zp-Zotpress .zp-Documentation code{background:#eaeaea}.zp-Documentation td,.zp-Documentation th,.zp-Documentation tr{border:none;font-weight:300;margin:0;padding:8px 16px;text-align:left;vertical-align:top}.zp-Documentation td{border-bottom:1px solid #f1f1f1;padding:12px 16px}.zp-Documentation .zebra td{background-color:#f9f9f9;border-bottom:1px solid #eee}.zp-Documentation p{margin:0}.zp-Documentation .main{background-color:#333;border-bottom:none;color:#fff;font:400 1.5em/1.5em Helvetica,"Helvetica Neue",Arial,sans-serif;text-transform:uppercase}.zp-Documentation .category,.zp-Documentation .type{font:600 1em/1.25em Helvetica,Arial,sans-serif;text-transform:uppercase}.zp-Documentation .category,.zp-Documentation .zebra .category{background-color:#666;border-bottom:1px solid #999;color:#fff}.zp-Documentation .type{background-color:#acbad5;border-bottom:1px solid #859ac2}.zp-Documentation .zebra .type{background-color:#99abcc;border-bottom:1px solid #859ac2}.zp-Documentation .code{background-color:#ffcb15;border-bottom:1px solid #f9a93e}.zp-Documentation .zebra .code{background-color:#ffb915;border-bottom:1px solid #f2aa00}.zp-Documentation .example{min-width:20em;padding-right:0}.zp-Documentation .example p{margin-bottom:.25em}.zp-Documentation p.break{margin-top:1em}.zp-Documentation td.last{border-bottom:none} diff --git a/css/zotpress.metabox.css b/css/zotpress.metabox.css index 8526db2..1c891d8 100644 --- a/css/zotpress.metabox.css +++ b/css/zotpress.metabox.css @@ -1,534 +1,667 @@ - - - /* START OF AUTOCOMPLETE CSS */ - - .ui-autocomplete.zp-autocomplete { - background: none; - background-color: #fff; - border: 1px solid #ddd; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); - -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); - margin: 0; - padding: 0; - max-height: 200px; - width: 253px !important; - overflow-y: auto; - overflow-x: hidden; /* prevent horizontal scrollbar */ - } - .ui-autocomplete.zp-autocomplete-wide { - width: 775px !important; - } - - .ui-autocomplete.zp-autocomplete li { - background: none; - border: none; - font-weight: 400; - font-size: 0.75rem; - line-height: 1.2; - margin: 0; - padding: 0; - white-space: normal; - /*width: 253px;*/ - } - .ui-autocomplete.zp-autocomplete-wide li { - /*width: 775px;*/ - } - - .ui-autocomplete.zp-autocomplete-wide li strong { - font-weight: 600; - } - - .ui-autocomplete.zp-autocomplete li a { - background: none; - border: none; - border-bottom: 1px solid #ddd; - color: #666; - margin: 0; - padding: 6px 10px 6px 10px; - } - .ui-autocomplete.zp-autocomplete li a.ui-state-focus, - .ui-autocomplete.zp-autocomplete li a.ui-state-hover { - background: none; - background-color: #eee; /* 8ec5fb */ - margin: 0; - - border-radius: 0; - -moz-border-radius: 0; - -webkit-border-radius: 0; - } - - .ui-tabs .ui-tabs-nav li a, - .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { - outline: none; - } - - /* END OF AUTOCOMPLETE CSS */ - - - - /* START OF IN-TEXT CSS */ - - div#zp-ZotpressMetaBox-Biblio-Citations, - div#zp-ZotpressMetaBox-Citations { - border: 5px solid #E14D43; - margin: 0.5em; - - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - } - div#zp-ZotpressMetaBox-Citations { - border: 5px solid #0080c0; - } - - input#zp-ZotpressMetaBox-Biblio-Citations-Search, - input#zp-ZotpressMetaBox-Citations-Search { - border: none; - background: #fff; - font-size: 1em; - margin: 0; - width: 100%; - } - input#zp-ZotpressMetaBox-Biblio-Citations-Search.ui-autocomplete-loading, - input#zp-ZotpressMetaBox-Citations-Search.ui-autocomplete-loading { - background: #fff url("../images/loading_default.gif") no-repeat 225px center; - } - input#zp-ZotpressMetaBox-Biblio-Citations-Search.help, - input#zp-ZotpressMetaBox-Citations-Search.help { - color: #aaa; - } - - div#zp-ZotpressMetaBox-Biblio-Shortcode, - div#zp-ZotpressMetaBox-InTextCreator-Shortcode { - padding: 0.75em; - } - div#zp-ZotpressMetaBox-Biblio-Shortcode-Inner, - div#zp-ZotpressMetaBox-InTextCreator-Shortcode-Inner { - background-color: #f6f6f6; - display: none; - margin: 0.75em 0 0 0; - padding: 0.75em; - } - - #ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-Biblio-Generate-Button, - #ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-InTextCreator-Generate-Button { - color: #fff; - float: right; - line-height: 1.75em; - height: auto; - } - #ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-Biblio-Clear-Button, - #ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-InTextCreator-Clear-Button { - float: left; - line-height: 1.75em; - height: auto; - } - - div#zp-ZotpressMetaBox-Biblio-Shortcode hr.clear, - div#zp-ZotpressMetaBox-InTextCreator-Shortcode hr.clear { - border: none; - clear: both; - margin: 0; - padding: 0; - visibility: hidden; - height: 1px; - } - - div#ZotpressMetaBox div#zp-ZotpressMetaBox-Biblio-Shortcode label, - div#ZotpressMetaBox div#zp-ZotpressMetaBox-InTextCreator-Shortcode label - { - font-size: 0.85em; - display: block; - line-height: 1em; - margin-bottom: 0.5em; - padding: 0; - } - - #zp-ZotpressMetaBox-Biblio-Shortcode-Text, - #zp-ZotpressMetaBox-InTextCreator-Text-Bib, - #zp-ZotpressMetaBox-InTextCreator-InText { - font-size: 0.85em; - width: 100%; - } - - div#zp-ZotpressMetaBox-InTextCreator-Text-Bib-Container { - margin-top: 0.75em; - } - div#zp-ZotpressMetaBox-Biblio-Text-Bib-Container label span, - div#zp-ZotpressMetaBox-InTextCreator-Text-Bib-Container label span { - color: #999; - font-weight: normal; - } - - /* Start of Visual Indicator Item CSS */ - - div#zp-ZotpressMetaBox-Biblio-Citations-List, - div#zp-ZotpressMetaBox-Citations-List { - padding: 0 1rem; - } - - div#zp-ZotpressMetaBox-Biblio-Citations-List div.item, - div#zp-ZotpressMetaBox-Citations-List div.item { - position: relative; - border-top: 1px solid #eee; - font-weight: 400; - font-size: 0.7rem; - line-height: 1.2; - padding: 0.5rem 0; - width: 100%; - } - div#zp-ZotpressMetaBox-Biblio-Citations-List div.item:first-child, - div#zp-ZotpressMetaBox-Citations-List div.item:first-child { - border-top: none; - } - - div#zp-ZotpressMetaBox-Biblio-Citations-List div.item .label, - div#zp-ZotpressMetaBox-Citations-List div.item .label { - display: block; - width: 90%; - } - - div#zp-ZotpressMetaBox-Biblio-Citations-List div.item .options, - div#zp-ZotpressMetaBox-Citations-List div.item .options { - margin: 0.5rem 0; - display: block; - width: 90%; - } - div#zp-ZotpressMetaBox-Biblio-Citations-List div.item .options:before, - div#zp-ZotpressMetaBox-Biblio-Citations-List div.item .options:after, - div#zp-ZotpressMetaBox-Citations-List div.item .options:before, - div#zp-ZotpressMetaBox-Citations-List div.item .options:after { - content: ""; - display: table; - } - div#zp-ZotpressMetaBox-Biblio-Citations-List div.item .options:after, - div#zp-ZotpressMetaBox-Citations-List div.item .options:after { - clear: both; - } - div#zp-ZotpressMetaBox-Biblio-Citations-List div.item .options label, - div#zp-ZotpressMetaBox-Citations-List div.item .options label { - float: left; - line-height: 1.5; - margin-right: 0.2rem; - } - div#zp-ZotpressMetaBox-Biblio-Citations-List div.item .options input, - div#zp-ZotpressMetaBox-Citations-List div.item .options input { - text-transform: uppercase; - font-weight: 600; - float: left; - font-size: 0.7rem; - padding: 0 0.2rem; - width: 40%; - } - - div#zp-ZotpressMetaBox-Biblio-Citations-List div.item .item_key, - div#zp-ZotpressMetaBox-Citations-List div.item .item_key { - display: block; - font-weight: 600; - margin-top: 0.25rem; - } - - div#zp-ZotpressMetaBox-Biblio-Citations-List div.item .delete, - div#zp-ZotpressMetaBox-Citations-List div.item .delete { - position: absolute; - top: 0.5rem; - right: 0; - background-color: #e14d43; - color: #fff; - cursor: pointer; - font-size: 0.8rem; - line-height: 1; - padding: 0.05rem 0.25rem; - - border-radius: 10px; - -moz-border-radius: 10px; - -webkit-border-radius: 10px; - } - - div#zp-ZotpressMetaBox-Biblio-Citations-List hr.clear, - div#zp-ZotpressMetaBox-Citations-List hr.clear { - background: none; - border: none; - height: 1px; - margin: 0; - padding: 0; - visibility: hidden; - } - - - /* Start of Account CSS */ - - div#zp-ZotpressMetaBox-Biblio-Account, - div#zp-ZotpressMetaBox-Account { - color: #999; - font-size: 0.85em; - margin: 0.5em 1em; - } - - - /* Start of Options CSS */ - - div#zp-ZotpressMetaBox-Biblio-Options, - div#zp-ZotpressMetaBox-InTextCreator-Options { - border-top: 1px solid #EEEEEE; - border-bottom: 1px solid #EEEEEE; - margin: 0; - } - - div#ZotpressMetaBox div#zp-ZotpressMetaBox-Biblio-Options h4, - div#ZotpressMetaBox div#zp-ZotpressMetaBox-InTextCreator-Options h4 { - margin: 0.75em; - } - - div#zp-ZotpressMetaBox-Biblio-Options-Inner, - div#zp-ZotpressMetaBox-InTextCreator-Options-Inner { - border-top: 1px solid #EEEEEE; - display: none; - padding: 0.25em 0; - } - div.zp-ZotpressMetaBox-Field { - font-size: 0.85em; - padding: 0.5em 1em; - } - div.zp-ZotpressMetaBox-Field-Radio { - font-size: 1.15em; - float: right; - margin-top: -0.2em; - } - div#ZotpressMetaBox div.zp-ZotpressMetaBox-Field-Radio label { - padding: 0; - } - div#zp-ZotpressMetaBox-Biblio-Options-Inner input, - div#zp-ZotpressMetaBox-Biblio-Options-Inner select, - div#zp-ZotpressMetaBox-InTextCreator-Options-Inner input, - div#zp-ZotpressMetaBox-InTextCreator-Options-Inner select { - font-size: 0.85em; - margin: 0.5em 1em 0.5em 0; - line-height: 1em; - } - div#zp-ZotpressMetaBox-Biblio-Options-Inner select, - div#zp-ZotpressMetaBox-InTextCreator-Options-Inner select { - height: auto; - } - - div#zp-ZotpressMetaBox-Biblio-Options div.right, - div#zp-ZotpressMetaBox-InTextCreator-Options div.right { - float: right; - line-height: 1; - } - - div#ZotpressMetaBox div#zp-ZotpressMetaBox-Biblio-Options h5, - div#ZotpressMetaBox div#zp-ZotpressMetaBox-InTextCreator-Options h5 { - background-color: #f9f9f9; - border-top: 1px solid #eee; - border-bottom: 1px solid #eee; - font-size: 1em; - font-weight: normal; - margin: 0.5em 0; - padding: 0.5em 0.75em; - } - div#ZotpressMetaBox div#zp-ZotpressMetaBox-InTextCreator-Options h5.first { - margin-top: -0.3em; - } - - div#zp-ZotpressMetaBox-Biblio-Options h4 span.toggle, - div#zp-ZotpressMetaBox-InTextCreator-Options h4 span.toggle { - background: #f7f7f7 url('../images/sprite.png') no-repeat -22px -466px; - border: 1px solid #dadada; - cursor: pointer; - display: inline-block; - line-height: 1em; - margin-left: 0.35em; - padding: 0; - /*padding: 0 0.65em;*/ - vertical-align: bottom; - width: 1.3em; - height: 1.3em; - - border-radius: 1em; - -moz-border-radius: 1em; - -webkit-border-radius: 1em; - } - div#zp-ZotpressMetaBox-Biblio-Options h4 span.toggle.active, - div#zp-ZotpressMetaBox-InTextCreator-Options h4 span.toggle.active { - background-color: #dadada; - } - - div#zp-ZotpressMetaBox-Biblio-Options hr, - div#zp-ZotpressMetaBox-InTextCreator-Options hr { - border: none; - background-color: #fff; - border-bottom: 1px solid #f6f6f6; - margin: 0.25em 0; - padding: 0; - height: 1px; - } - - input#zp-ZotpressMetaBox-Biblio-Options-Format, - input#zp-ZotpressMetaBox-InTextCreator-Options-Format { - min-width: 185px; - } - - div#zp-ZotpressMetaBox-Biblio-Options p.note, - div#zp-ZotpressMetaBox-InTextCreator-Options p.note { - color: #999; - font-size: 0.75em; - margin: 0 1em 0.75em; - } - - /* END OF IN-TEXT CSS */ - - - - /* START OF GENERIC METABOX CSS */ - - div#ZotpressMetaBox.postbox div.inside { - /*padding: 0 6px;*/ - margin: 0; - padding: 0; - } - - div#ZotpressMetaBox h3.hndle span { - background: transparent url('../images/icon.png') no-repeat left center; - padding-left: 22px; - } - - div.zp-ZotpressMetaBox-Tabs { - border-radius: 5px; - -moz-border-radius: 5px; - border: 1px solid #ccc; - padding: 1px; - margin-bottom: 10px; - } - div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav { - display: none; - border-radius: 4px 4px 0 0; - -moz-border-radius: 4px 4px 0 0; - background-color: #f6f6f6; - padding: 3px; - padding-bottom: 0; - overflow: hidden; - /*height: 20px;*/ - } - div.zp-ZotpressMetaBox-Tabs ul li, - div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li { - margin: 0; - padding: 5px 5px 0; - float: left; - height: 13px; - } - div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li.ui-state-active { - border-radius: 4px 4px 0 0; - -moz-border-radius: 4px 4px 0 0; - background-color: #fff; - height: 13px; - } - div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li a { - /*font: 9px/10px 'Arial', sans-serif;*/ - letter-spacing: 1px; - padding: 0 3px; - text-decoration: none; - text-transform: uppercase; - vertical-align: top; - } - div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li.ui-state-active a { - color: #333; - } - div.zp-ZotpressMetaBox-Tabs input[type="radio"] { - vertical-align: text-top; - } - - div#ZotpressMetaBox h4 { - margin: 0; - padding: 0; - } - - div#zp-ZotpressMetaBox-Biblio-Options label, - div#zp-ZotpressMetaBox-InTextCreator-Options label{ - font-size: 0.85em; - margin: 0; - padding: 0 1em; - font-weight: bold; - } - div#ZotpressMetaBox div.zp-Tab label { - font-size: 12px; - display: block; - margin: 0; - padding: 0 0 5px 0; - } - div#ZotpressMetaBox div.zp-Tab select { - width: 100%; - height: 5em !important; - } - - div.zp-Tab { - background-color: #fff; - padding: 0.6em !important; - } - p.zp-Note { - font-size: 9px !important; - font-style: italic !important; - color: #aaaaaa !important; - margin-top: 0 !important; - } - p.zp-Note { - font-size: 10px !important; - color: #888 !important; - } - div.zp-Tab span.label { - margin-top: 5px; - font-weight: bold; - } - div.zp-Tab span.label em { - font-style: normal; - text-decoration: underline; - } - - .postbox div.zp-Tab input[type="text"], - div.zp-Tab select { - margin-bottom: 10px; - } - - /* MAIN */ - #normal-sortables .zp-ZotpressMetaBox-Tabs .sm { - display: none; - } - #normal-sortables .zp-ZotpressMetaBox-Tabs .wide { - display: block; - } - /* MAIN */ - - /* SIDEBAR */ - #side-sortables .zp-ZotpressMetaBox-Tabs .sm { - display: block; - } - #side-sortables .zp-ZotpressMetaBox-Tabs .wide { - display: none; - } - /* SIDEBAR */ - - .bibOnly { - display: none; - } - - - - /* START OF CKEDIT STYLES */ - - span.zp-Zotpress-Citation { - background-color: #eee !important; - } - span.zp-Zotpress-Citation:hover { - background-color: #ddd !important; - } - - span.zp-Zotpress-Citation span.zp-Zotpress-Citation-Shortcode { - display: none !important; - } - - span.zp-Zotpress-Citation span.zp-Zotpress-Citation-Info { - display: inline !important; - } - - /* END OF CKEDIT STYLES */ - \ No newline at end of file + +/* START OF SHORTCODE BUILDER CSS */ + +#zp-ZotpressMetaBox.zp-ShortcodeBuilder { + z-index: 100; + position: absolute; + top: calc(50% - 25vh); + left: calc(50% - 18vw); + width: 34vw; + height: auto; + max-height: 50vh; + + background-color: #fff; + border: 1px solid #333; + filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.1)); + overflow-y: auto; +} +.is-sidebar-opened #zp-ZotpressMetaBox.zp-ShortcodeBuilder { + left: calc(((100% - 280px) / 2) - 18vw); +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Inner { + padding: 6px 15px 15px 15px; +} + +#zp-ShortcodeBuilder-Close { + display: none; +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ShortcodeBuilder-Close { + position: absolute; + top: 3px; + right: 3px; + display: inline-block; +} + +/* search autocomplete */ + +#zp-ZotpressMetaBox.zp-ShortcodeBuilder select#zp-ZotpressMetaBox-Acccount-Select { + border: none; + font-size: 0.9em; + width: auto; +} + +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Account, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Search-Inner, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-List, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Type, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Biblio-Options, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Biblio-Generate, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-InText-Options, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-InText-Generate, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-InTextBib-Options, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-InTextBib-Generate { + margin-left: 0; + margin-right: 0; +} + +#zp-ZotpressMetaBox-Type { + border: none; + margin: 0 15px; + padding: 0; +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Type { + margin: 0; + padding: 0; + overflow: auto; +} +#zp-ZotpressMetaBox-Type h4 { + display: none; +} +#zp-ZotpressMetaBox-Type ul, +#zp-ZotpressMetaBox-Type ul li { + margin: 0; + padding: 0; +} +#zp-ZotpressMetaBox-Type ul li.ui-tab a { + box-shadow: none !important; + color: #1e1e1e; + float: left; + padding: 8px 14px; + text-decoration: none; +} +#zp-ZotpressMetaBox-Type ul li.ui-tabs-active a { + border-bottom: 3px solid var(--wp-admin-theme-color); + padding-bottom: 5px; +} + +/* options */ + +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Biblio-Options-Inner, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-InText-Options-Inner, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-InTextBib-Options-Inner { + padding: 8px 0; +} + +#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub { + margin: 0; + padding: 8px 12px; +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub h4 { + margin: 0; + padding: 0; +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub h4 span.toggle { + padding: 0; +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub h4 span.toggle-button { + margin: 4px 0 0 0; +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub-Inner { + padding: 10px 0 0; +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub label { + display: block; + padding: 0; +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub p.note { + margin: 0.5em 0 0.75em 14px; +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub .zp-ZotpressMetaBox-Field-Radio label { + padding: 0 0 0 1em; +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub .zp-ZotpressMetaBox-Field-Radio input { + margin: 0 4px; +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder div.zp-ZotpressMetaBox-Sub hr { + margin: 5px 0; +} +#zp-ZotpressMetaBox.zp-ShortcodeBuilder div#zp-ZotpressMetaBox-Biblio-Generate, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder div#zp-ZotpressMetaBox-InText-Generate, +#zp-ZotpressMetaBox.zp-ShortcodeBuilder div#zp-ZotpressMetaBox-InTextBib-Generate { + margin-bottom: 0; +} + +/* There's a CSS gap/bug where Dashicons aren't styled in the editor menu */ + +#editor .components-dropdown-menu__menu .components-button.has-icon .dashicon { + margin-right: 12px; +} + +/* END OF SHORTCODE BUILDER CSS */ + + + +/* + THE BELOW IS POTENTIALLY LEGACY CODE + and should be incorporated above +*/ + + + +/* START OF AUTOCOMPLETE CSS */ + +.ui-autocomplete.zp-autocomplete { + background: none; + background-color: #fff; + border: 1px solid #ddd; + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04); + margin: 0; + padding: 0; + max-height: 200px; + width: 253px !important; + overflow-y: auto; + overflow-x: hidden; /* prevent horizontal scrollbar */ +} +.ui-autocomplete.zp-autocomplete-wide { + width: 775px !important; +} + +.ui-autocomplete.zp-autocomplete li { + background: none; + border: none; + font-weight: 400; + font-size: 0.75rem; + line-height: 1.2; + margin: 0; + padding: 0; + white-space: normal; +} + +.ui-autocomplete.zp-autocomplete-wide li strong { + font-weight: 600; +} + +.ui-autocomplete.zp-autocomplete li a { + background: none; + border: none; + border-bottom: 1px solid #ddd; + display: block; + color: #666; + margin: 0; + padding: 6px 10px 6px 10px; +} +.ui-autocomplete.zp-autocomplete li a.ui-state-focus, +.ui-autocomplete.zp-autocomplete li a.ui-state-hover { + background: none; + background-color: #eee; /* 8ec5fb */ + margin: 0; + + border-radius: 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; +} + +.ui-tabs .ui-tabs-nav li a, +.ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { + outline: none; +} + +/* END OF AUTOCOMPLETE CSS */ + + + +/* START OF CREATOR BASICS */ + +.zp-ZotpressMetaBox-Sub { + border: 1px solid #EEEEEE; + margin: 0 15px; + padding: 0 5px; +} + +/* END OF CREATOR BASICS */ + + + +/* START OF IN-TEXT CREATOR CSS */ + +div#zp-ZotpressMetaBox-InText { + display: none; +} + + +/* START OF SEARCH CSS */ + +div#zp-ZotpressMetaBox-Search { + margin-bottom: 10px; +} +div#zp-ZotpressMetaBox-Search-Inner { + border: 5px solid #E14D43; + margin: 5px 15px; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +input#zp-ZotpressMetaBox-Search-Input { + border: none; + box-shadow: none !important; + background: #fff; + font-size: inherit; + margin: 0; + padding: 4px 10px; + width: calc(100% - 4px); + height: 22px; +} +input#zp-ZotpressMetaBox-Search-Input.ui-autocomplete-loading { + background: #fff url("../images/loading_default.gif") no-repeat right center; +} +/* input#zp-ZotpressMetaBox-Search-Input.help { + color: #aaa; +} */ + + +/* Start of generate */ + +div#zp-ZotpressMetaBox-Biblio-Generate, +div#zp-ZotpressMetaBox-InText-Generate, +div#zp-ZotpressMetaBox-InTextBib-Generate { + background: none; + margin: 15px; +} +div#zp-ZotpressMetaBox-Biblio-Generate-Inner, +div#zp-ZotpressMetaBox-InText-Generate-Inner, +div#zp-ZotpressMetaBox-InTextBib-Generate-Inner { + display: none; + margin: 15px 0 0 0; +} + +#ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-Biblio-Generate-Button, +#ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-InText-Generate-Button, +#ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-InTextBib-Generate-Button { + color: #fff; + height: auto; +} +#ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-Biblio-Clear-Button, +#ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-InText-Clear-Button, +#ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-InTextBib-Clear-Button { + float: right; + height: auto; +} + +div#zp-ZotpressMetaBox-Biblio-Generate hr.clear, +div#zp-ZotpressMetaBox-InText-Generate hr.clear, +div#zp-ZotpressMetaBox-InTextBib-Generate hr.clear { + border: none; + clear: both; + margin: 0; + padding: 0; + visibility: hidden; + height: 1px; +} + +div#ZotpressMetaBox div#zp-ZotpressMetaBox-Biblio-Generate label, +div#ZotpressMetaBox div#zp-ZotpressMetaBox-InText-Generate label, +div#ZotpressMetaBox div#zp-ZotpressMetaBox-InTextBib-Generate label { + font-size: 13px; + display: block; + line-height: 1em; + margin-bottom: 0.5em; + padding: 0; +} + +#zp-ZotpressMetaBox-Biblio-Generate-Text, +#zp-ZotpressMetaBox-InText-Generate-Text, +#zp-ZotpressMetaBox-InTextBib-Generate-Text { + font-size: 13px; + width: 100%; +} + +/* Start of Visual Indicator Item CSS */ + +div#zp-ZotpressMetaBox-List { + margin-bottom: 10px; + padding: 0 20px; +} + +div#zp-ZotpressMetaBox-List div.item { + position: relative; + border-top: 1px solid #eee; + font-weight: 400; + font-size: 0.7rem; + line-height: 1.2; + padding: 0.5rem 0; + width: 100%; +} +div#zp-ZotpressMetaBox-List div.item:first-child { + border-top: none; +} + +div#zp-ZotpressMetaBox-List div.item .label { + display: block; + width: 90%; +} + +div#zp-ZotpressMetaBox-List div.item .options { + margin: 0.5rem 0; + display: none; + width: 90%; +} +div#zp-ZotpressMetaBox-List.intext div.item .options { + display: block; +} +div#zp-ZotpressMetaBox-List div.item .options:before, +div#zp-ZotpressMetaBox-List div.item .options:after { + content: ""; + display: table; +} +div#zp-ZotpressMetaBox-List div.item .options:after { + clear: both; +} +div#zp-ZotpressMetaBox-List div.item .options label { + float: left; + line-height: 1.5; + margin-right: 0.2rem; +} +div#zp-ZotpressMetaBox-List div.item .options input { + text-transform: uppercase; + font-weight: 600; + float: left; + font-size: 0.7rem; + padding: 0 0.2rem; + width: 40%; +} + +div#zp-ZotpressMetaBox-List div.item .item_key, +div#zp-ZotpressMetaBox-List div.item .account { + display: block; + margin-top: 0.25rem; +} +div#zp-ZotpressMetaBox-List div.item .account { + margin-top: 0; +} + +div#zp-ZotpressMetaBox-List div.item .delete { + position: absolute; + top: 0.5rem; + right: 0; + background-color: #e14d43; + color: #fff; + cursor: pointer; + font-size: 1.25em; + line-height: 1; + padding: 0.05em 0.35em 0.25em 0.35em; + + border-radius: 1em; + -moz-border-radius: 1em; + -webkit-border-radius: 1em; +} + +div#zp-ZotpressMetaBox-List hr.clear { + background: none; + border: none; + height: 1px; + margin: 0; + padding: 0; + visibility: hidden; +} + + +/* Start of Account CSS */ + +.edit-post-meta-boxes-area #poststuff div#ZotpressMetaBox h2.hndle { + color: #191e23; /* 555d66 */ + font-size: inherit; + border-bottom: 0; +} + +#zp-ZotpressMetaBox-Account { + margin: 0 15px; +} +#zp-ZotpressMetaBox-Account label { + display: none; +} +select#zp-ZotpressMetaBox-Acccount-Select { + /* width: calc(100% - 4px); */ + width: calc(100% - 35px); + height: 22px; +} + + +/* START OF OPTIONS CSS */ + +#zp-ZotpressMetaBox #zp-ZotpressMetaBox-Biblio-Options-Inner, +#zp-ZotpressMetaBox #zp-ZotpressMetaBox-InText-Options-Inner, +#zp-ZotpressMetaBox #zp-ZotpressMetaBox-InTextBib-Options-Inner { + display: none; + font-size: 0.9em; + line-height: 2; + padding: 5px; +} +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub h4 { + color: #555d66; + font-weight: normal; + margin: 0; + padding: 0; +} + +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Field { + font-size: inherit; + display: flex; + align-items: center; + justify-content: space-between; +} +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Field-Radio { + display: flex; + align-items: center; + justify-content: space-between; +} +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Field-Radio label { + font-size: 0.9em; + text-transform: uppercase; + margin: 0 4px 0 15px; + padding: 0; +} + +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub input, +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub select { + font-size: inherit; +} +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub select { + height: auto; + min-height: 1em; +} + +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub .right { + float: right; + line-height: 1; +} + +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub h5 { + border-top: 1px solid #eee; + font-size: 1em; + font-weight: bold; + margin: 0.5em 0; + padding: 1em 0 0.25em; +} + +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub span.toggle { + cursor: pointer; + display: block; + font-size: 0.8em; + font-weight: normal; + line-height: 2; + padding: 5px; + text-transform: uppercase; + width: 100%; +} +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub span.toggle-button { + content: "\f347"; + cursor: pointer; + display: inline-block; + float: right; + font-size: 15px; + line-height: 15px; + margin: 4px 8px 0 0; + padding: 0; + text-align: right; + width: auto; + height: 16px; +} +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub span.toggle-button.dashicons-arrow-up-alt2 { + content: "\f343"; +} + +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub hr { + border: none; + background-color: #fff; + clear: both; + margin: 10px 0 0; + padding: 0; + height: 1px; +} +div#ZotpressMetaBox div#zp-ZotpressMetaBox-Biblio-Options select#zp-ZotpressMetaBox-Biblio-Options-Style { + float: none; +} + +input#zp-ZotpressMetaBox-Biblio-Options-Format, +input#zp-ZotpressMetaBox-InText-Options-Format, +input#zp-ZotpressMetaBox-InTextBib-Options-Format { + min-width: 185px; +} + +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub p.note { + color: #666; + font-size: 0.8em; + margin: 0.5em 1em 1em; +} +#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub p.note code { + font-size: 1.1em; +} + +/* END OF IN-TEXT CSS */ + + + +/* START OF GENERIC METABOX CSS */ + +div#zp-ZotpressMetaBox-Inner { + padding: 15px 0; +} + +div#ZotpressMetaBox.postbox div.inside { + margin: 0; + padding: 0; +} + +div#ZotpressMetaBox h3.hndle span { + background: transparent url('../images/icon.png') no-repeat left center; + padding-left: 22px; +} + +div.zp-ZotpressMetaBox-Tabs { + border-radius: 5px; + -moz-border-radius: 5px; + border: 1px solid #ccc; + padding: 1px; + margin-bottom: 10px; +} +div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav { + display: none; + border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + background-color: #f6f6f6; + padding: 3px; + padding-bottom: 0; + overflow: hidden; +} +div.zp-ZotpressMetaBox-Tabs ul li, +div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li { + margin: 0; + padding: 5px 5px 0; + float: left; + height: 13px; +} +div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li.ui-state-active { + border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + background-color: #fff; + height: 13px; +} +div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li a { + /*font: 9px/10px 'Arial', sans-serif;*/ + letter-spacing: 1px; + padding: 0 3px; + text-decoration: none; + text-transform: uppercase; + vertical-align: top; +} +div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li.ui-state-active a { + color: #333; +} +div.zp-ZotpressMetaBox-Tabs input[type="radio"] { + vertical-align: text-top; +} + +div#ZotpressMetaBox h4 { + margin: 0; + padding: 0; +} + +div#ZotpressMetaBox div.zp-Tab label { + font-size: 12px; + display: block; + margin: 0; + padding: 0 0 5px 0; +} +div#ZotpressMetaBox div.zp-Tab select { + width: 100%; + height: 5em !important; +} + +div.zp-Tab { + background-color: #fff; + padding: 0.6em !important; +} +p.zp-Note { + font-size: 9px !important; + font-style: italic !important; + color: #aaaaaa !important; + margin-top: 0 !important; +} +p.zp-Note { + font-size: 10px !important; + color: #888 !important; +} +div.zp-Tab span.label { + margin-top: 5px; + font-weight: bold; +} +div.zp-Tab span.label em { + font-style: normal; + text-decoration: underline; +} + +.postbox div.zp-Tab input[type="text"], +div.zp-Tab select { + margin-bottom: 10px; +} + +/* MAIN */ +#normal-sortables .zp-ZotpressMetaBox-Tabs .sm { + display: none; +} +#normal-sortables .zp-ZotpressMetaBox-Tabs .wide { + display: block; +} +/* MAIN */ + +/* SIDEBAR */ +#side-sortables .zp-ZotpressMetaBox-Tabs .sm { + display: block; +} +#side-sortables .zp-ZotpressMetaBox-Tabs .wide { + display: none; +} +/* SIDEBAR */ diff --git a/css/zotpress.metabox.min.css b/css/zotpress.metabox.min.css new file mode 100644 index 0000000..1d2a73a --- /dev/null +++ b/css/zotpress.metabox.min.css @@ -0,0 +1 @@ +#zp-ZotpressMetaBox.zp-ShortcodeBuilder{z-index:100;position:absolute;top:calc(50% - 25vh);left:calc(50% - 18vw);width:34vw;height:auto;max-height:50vh;background-color:#fff;border:1px solid #333;filter:drop-shadow(3px 3px 0 rgba(0, 0, 0, .1));overflow-y:auto}.is-sidebar-opened #zp-ZotpressMetaBox.zp-ShortcodeBuilder{left:calc(((100% - 280px)/ 2) - 18vw)}#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Inner{padding:6px 15px 15px 15px}#zp-ShortcodeBuilder-Close{display:none}#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ShortcodeBuilder-Close{position:absolute;top:3px;right:3px;display:inline-block}#zp-ZotpressMetaBox.zp-ShortcodeBuilder select#zp-ZotpressMetaBox-Acccount-Select{border:none;font-size:.9em;width:auto}#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Account,#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Biblio-Generate,#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Biblio-Options,#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-InText-Generate,#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-InText-Options,#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-InTextBib-Generate,#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-InTextBib-Options,#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-List,#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Search-Inner,#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Type{margin-left:0;margin-right:0}#zp-ZotpressMetaBox-Type{border:none;margin:0 15px;padding:0}#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Type{margin:0;padding:0;overflow:auto}#zp-ZotpressMetaBox-Type h4{display:none}#zp-ZotpressMetaBox-Type ul,#zp-ZotpressMetaBox-Type ul li{margin:0;padding:0}#zp-ZotpressMetaBox-Type ul li.ui-tab a{box-shadow:none!important;color:#1e1e1e;float:left;padding:8px 14px;text-decoration:none}#zp-ZotpressMetaBox-Type ul li.ui-tabs-active a{border-bottom:3px solid var(--wp-admin-theme-color);padding-bottom:5px}#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-Biblio-Options-Inner,#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-InText-Options-Inner,#zp-ZotpressMetaBox.zp-ShortcodeBuilder #zp-ZotpressMetaBox-InTextBib-Options-Inner{padding:8px 0}#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub{margin:0;padding:8px 12px}#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub h4{margin:0;padding:0}#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub h4 span.toggle{padding:0}#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub h4 span.toggle-button{margin:4px 0 0 0}#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub-Inner{padding:10px 0 0}#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub label{display:block;padding:0}#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub p.note{margin:.5em 0 .75em 14px}#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub .zp-ZotpressMetaBox-Field-Radio label{padding:0 0 0 1em}#zp-ZotpressMetaBox.zp-ShortcodeBuilder .zp-ZotpressMetaBox-Sub .zp-ZotpressMetaBox-Field-Radio input{margin:0 4px}#zp-ZotpressMetaBox.zp-ShortcodeBuilder div.zp-ZotpressMetaBox-Sub hr{margin:5px 0}#zp-ZotpressMetaBox.zp-ShortcodeBuilder div#zp-ZotpressMetaBox-Biblio-Generate,#zp-ZotpressMetaBox.zp-ShortcodeBuilder div#zp-ZotpressMetaBox-InText-Generate,#zp-ZotpressMetaBox.zp-ShortcodeBuilder div#zp-ZotpressMetaBox-InTextBib-Generate{margin-bottom:0}#editor .components-dropdown-menu__menu .components-button.has-icon .dashicon{margin-right:12px}.ui-autocomplete.zp-autocomplete{background:0 0;background-color:#fff;border:1px solid #ddd;box-shadow:0 1px 1px rgba(0,0,0,.04);-moz-box-shadow:0 1px 1px rgba(0,0,0,.04);margin:0;padding:0;max-height:200px;width:253px!important;overflow-y:auto;overflow-x:hidden}.ui-autocomplete.zp-autocomplete-wide{width:775px!important}.ui-autocomplete.zp-autocomplete li{background:0 0;border:none;font-weight:400;font-size:.75rem;line-height:1.2;margin:0;padding:0;white-space:normal}.ui-autocomplete.zp-autocomplete-wide li strong{font-weight:600}.ui-autocomplete.zp-autocomplete li a{background:0 0;border:none;border-bottom:1px solid #ddd;display:block;color:#666;margin:0;padding:6px 10px 6px 10px}.ui-autocomplete.zp-autocomplete li a.ui-state-focus,.ui-autocomplete.zp-autocomplete li a.ui-state-hover{background:0 0;background-color:#eee;margin:0;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0}.ui-tabs .ui-tabs-nav li a,.ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a{outline:0}.zp-ZotpressMetaBox-Sub{border:1px solid #eee;margin:0 15px;padding:0 5px}div#zp-ZotpressMetaBox-InText{display:none}div#zp-ZotpressMetaBox-Search{margin-bottom:10px}div#zp-ZotpressMetaBox-Search-Inner{border:5px solid #e14d43;margin:5px 15px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px}input#zp-ZotpressMetaBox-Search-Input{border:none;box-shadow:none!important;background:#fff;font-size:inherit;margin:0;padding:4px 10px;width:calc(100% - 4px);height:22px}input#zp-ZotpressMetaBox-Search-Input.ui-autocomplete-loading{background:#fff url(../images/loading_default.gif) no-repeat right center}div#zp-ZotpressMetaBox-Biblio-Generate,div#zp-ZotpressMetaBox-InText-Generate,div#zp-ZotpressMetaBox-InTextBib-Generate{background:0 0;margin:15px}div#zp-ZotpressMetaBox-Biblio-Generate-Inner,div#zp-ZotpressMetaBox-InText-Generate-Inner,div#zp-ZotpressMetaBox-InTextBib-Generate-Inner{display:none;margin:15px 0 0 0}#ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-Biblio-Generate-Button,#ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-InText-Generate-Button,#ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-InTextBib-Generate-Button{color:#fff;height:auto}#ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-Biblio-Clear-Button,#ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-InText-Clear-Button,#ZotpressMetaBox .ui-widget-content a#zp-ZotpressMetaBox-InTextBib-Clear-Button{float:right;height:auto}div#zp-ZotpressMetaBox-Biblio-Generate hr.clear,div#zp-ZotpressMetaBox-InText-Generate hr.clear,div#zp-ZotpressMetaBox-InTextBib-Generate hr.clear{border:none;clear:both;margin:0;padding:0;visibility:hidden;height:1px}div#ZotpressMetaBox div#zp-ZotpressMetaBox-Biblio-Generate label,div#ZotpressMetaBox div#zp-ZotpressMetaBox-InText-Generate label,div#ZotpressMetaBox div#zp-ZotpressMetaBox-InTextBib-Generate label{font-size:13px;display:block;line-height:1em;margin-bottom:.5em;padding:0}#zp-ZotpressMetaBox-Biblio-Generate-Text,#zp-ZotpressMetaBox-InText-Generate-Text,#zp-ZotpressMetaBox-InTextBib-Generate-Text{font-size:13px;width:100%}div#zp-ZotpressMetaBox-List{margin-bottom:10px;padding:0 20px}div#zp-ZotpressMetaBox-List div.item{position:relative;border-top:1px solid #eee;font-weight:400;font-size:.7rem;line-height:1.2;padding:.5rem 0;width:100%}div#zp-ZotpressMetaBox-List div.item:first-child{border-top:none}div#zp-ZotpressMetaBox-List div.item .label{display:block;width:90%}div#zp-ZotpressMetaBox-List div.item .options{margin:.5rem 0;display:none;width:90%}div#zp-ZotpressMetaBox-List.intext div.item .options{display:block}div#zp-ZotpressMetaBox-List div.item .options:after,div#zp-ZotpressMetaBox-List div.item .options:before{content:"";display:table}div#zp-ZotpressMetaBox-List div.item .options:after{clear:both}div#zp-ZotpressMetaBox-List div.item .options label{float:left;line-height:1.5;margin-right:.2rem}div#zp-ZotpressMetaBox-List div.item .options input{text-transform:uppercase;font-weight:600;float:left;font-size:.7rem;padding:0 .2rem;width:40%}div#zp-ZotpressMetaBox-List div.item .account,div#zp-ZotpressMetaBox-List div.item .item_key{display:block;margin-top:.25rem}div#zp-ZotpressMetaBox-List div.item .account{margin-top:0}div#zp-ZotpressMetaBox-List div.item .delete{position:absolute;top:.5rem;right:0;background-color:#e14d43;color:#fff;cursor:pointer;font-size:1.25em;line-height:1;padding:.05em .35em .25em .35em;border-radius:1em;-moz-border-radius:1em;-webkit-border-radius:1em}div#zp-ZotpressMetaBox-List hr.clear{background:0 0;border:none;height:1px;margin:0;padding:0;visibility:hidden}.edit-post-meta-boxes-area #poststuff div#ZotpressMetaBox h2.hndle{color:#191e23;font-size:inherit;border-bottom:0}#zp-ZotpressMetaBox-Account{margin:0 15px}#zp-ZotpressMetaBox-Account label{display:none}select#zp-ZotpressMetaBox-Acccount-Select{width:calc(100% - 35px);height:22px}#zp-ZotpressMetaBox #zp-ZotpressMetaBox-Biblio-Options-Inner,#zp-ZotpressMetaBox #zp-ZotpressMetaBox-InText-Options-Inner,#zp-ZotpressMetaBox #zp-ZotpressMetaBox-InTextBib-Options-Inner{display:none;font-size:.9em;line-height:2;padding:5px}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub h4{color:#555d66;font-weight:400;margin:0;padding:0}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Field{font-size:inherit;display:flex;align-items:center;justify-content:space-between}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Field-Radio{display:flex;align-items:center;justify-content:space-between}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Field-Radio label{font-size:.9em;text-transform:uppercase;margin:0 4px 0 15px;padding:0}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub input,#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub select{font-size:inherit}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub select{height:auto;min-height:1em}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub .right{float:right;line-height:1}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub h5{border-top:1px solid #eee;font-size:1em;font-weight:700;margin:.5em 0;padding:1em 0 .25em}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub span.toggle{cursor:pointer;display:block;font-size:.8em;font-weight:400;line-height:2;padding:5px;text-transform:uppercase;width:100%}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub span.toggle-button{content:"\f347";cursor:pointer;display:inline-block;float:right;font-size:15px;line-height:15px;margin:4px 8px 0 0;padding:0;text-align:right;width:auto;height:16px}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub span.toggle-button.dashicons-arrow-up-alt2{content:"\f343"}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub hr{border:none;background-color:#fff;clear:both;margin:10px 0 0;padding:0;height:1px}div#ZotpressMetaBox div#zp-ZotpressMetaBox-Biblio-Options select#zp-ZotpressMetaBox-Biblio-Options-Style{float:none}input#zp-ZotpressMetaBox-Biblio-Options-Format,input#zp-ZotpressMetaBox-InText-Options-Format,input#zp-ZotpressMetaBox-InTextBib-Options-Format{min-width:185px}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub p.note{color:#666;font-size:.8em;margin:.5em 1em 1em}#zp-ZotpressMetaBox .zp-ZotpressMetaBox-Sub p.note code{font-size:1.1em}div#zp-ZotpressMetaBox-Inner{padding:15px 0}div#ZotpressMetaBox.postbox div.inside{margin:0;padding:0}div#ZotpressMetaBox h3.hndle span{background:transparent url(../images/icon.png) no-repeat left center;padding-left:22px}div.zp-ZotpressMetaBox-Tabs{border-radius:5px;-moz-border-radius:5px;border:1px solid #ccc;padding:1px;margin-bottom:10px}div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav{display:none;border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;background-color:#f6f6f6;padding:3px;padding-bottom:0;overflow:hidden}div.zp-ZotpressMetaBox-Tabs ul li,div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li{margin:0;padding:5px 5px 0;float:left;height:13px}div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li.ui-state-active{border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;background-color:#fff;height:13px}div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li a{letter-spacing:1px;padding:0 3px;text-decoration:none;text-transform:uppercase;vertical-align:top}div.zp-ZotpressMetaBox-Tabs ul.ui-tabs-nav li.ui-state-active a{color:#333}div.zp-ZotpressMetaBox-Tabs input[type=radio]{vertical-align:text-top}div#ZotpressMetaBox h4{margin:0;padding:0}div#ZotpressMetaBox div.zp-Tab label{font-size:12px;display:block;margin:0;padding:0 0 5px 0}div#ZotpressMetaBox div.zp-Tab select{width:100%;height:5em!important}div.zp-Tab{background-color:#fff;padding:.6em!important}p.zp-Note{font-size:9px!important;font-style:italic!important;color:#aaa!important;margin-top:0!important}p.zp-Note{font-size:10px!important;color:#888!important}div.zp-Tab span.label{margin-top:5px;font-weight:700}div.zp-Tab span.label em{font-style:normal;text-decoration:underline}.postbox div.zp-Tab input[type=text],div.zp-Tab select{margin-bottom:10px}#normal-sortables .zp-ZotpressMetaBox-Tabs .sm{display:none}#normal-sortables .zp-ZotpressMetaBox-Tabs .wide{display:block}#side-sortables .zp-ZotpressMetaBox-Tabs .sm{display:block}#side-sortables .zp-ZotpressMetaBox-Tabs .wide{display:none} diff --git a/css/zotpress.shortcode.css b/css/zotpress.shortcode.css index dbeaed4..ac1365d 100644 --- a/css/zotpress.shortcode.css +++ b/css/zotpress.shortcode.css @@ -1,196 +1,316 @@ +/* START OF BASIC SHORTCODES */ - /* START OF BASIC SHORTCODE CSS */ - - div.zp-Zotpress { - margin: 0 0 1em; - } - - /* Thanks to http://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/ */ - div.zp-Zotpress a { - -ms-word-break: break-all; - word-break: break-all; - word-break: break-word; - -webkit-hyphens: auto; - -moz-hyphens: auto; - hyphens: auto; - } - - div.zp-Zotpress div.zp-Entry.zp-HasImage { - clear: both; - min-height: 150px; - } - div.zp-Zotpress div.zp-Entry-Image { - float: left; - } - - div.zp-Zotpress div.zp-Entry .csl-left-margin { - width: auto !important; - } - - div.zp-Zotpress div.zp-Entry.zp-HasImage div.csl-bib-body { - margin-left: 170px; - } - - div.zp-Zotpress span.zp-Loading { - border: 1px solid #ddd; - border-radius: 5px; - -moz-border-radius: 5px; - background: #f3f3f3 url('images/loading_list.gif') no-repeat top left; - display: block; - margin: auto; - overflow: hidden; - width: 33px; - height: 32px; - } - div.zp-Zotpress span.zp-Loading span { - visibility: hidden; - } - div.zp-Zotpress p.zp-NoCitations { - margin: 0; - } - - a.zp-CiteRIS, - a.zp-DownloadURL { - font-size: 0.9em; - text-transform: uppercase; - } - a.zp-CiteRIS:before, - a.zp-DownloadURL:before { - content: "("; - } - a.zp-CiteRIS:after, - a.zp-DownloadURL:after { - content: ")"; - } - - - /* In-Text Citations */ - - .zp-ZotpressShortcode.cite .summary, - .zp-ZotpressShortcode.bib .summary { - display: none; - } - - - - /* START OF BROWSE LIB */ - - #zp-Browse-Bar { - background-color: #fff; - border: 2px solid #000; - } - #zp-Browse-Bar:before, - #zp-Browse-Bar:after { - content: ""; - display: table; - } - #zp-Browse-Bar:after { - clear: both; - } - - #zp-Browse-Collections, - #zp-Browse-Tags { - float: left; - width: 50%; - } - - .zp-Browse-Select { - overflow: hidden; - width: 100%; - height: 34px; - } - .zp-Browse-Select select { - background: transparent; - border: none; - color: #000; - cursor: pointer; - font-size: 1em; - margin: 0; - padding: 0 0.5em; - width: 100%; - height: 34px; - } - #zp-Browse-Collections-Select { - border-right: 2px solid #000; - } - - #zp-Pagination, - .zp-Collection-Title { - letter-spacing: 0.15em; - font-size: 0.9em; - font-weight: bold; - margin: 3em 0 2em; - text-transform: uppercase; - } - #zp-Pagination { - margin: 2em 0 0; - } - - .zp-Entry-Image { - float: right; - margin: 0 0 1em 1em; - } - - #zp-Zotpress-SearchBox input[type="radio"] { - cursor: pointer; - margin: 0.5em; - vertical-align: middle; - } - #zp-Zotpress-SearchBox label { - cursor: pointer; - } - #zp-Zotpress-SearchBox .zp-SearchBy { - margin-left: 0.5em; - } - - .zpSearchLoading { - visibility: hidden; - display: block; - margin: 1em auto; - } - .zpSearchLoading.show { - visibility: visible; - } - - .zpSearchResultsItem .item_key { - display: block; - font-weight: bold; - margin-bottom: 2em; - } - - .zpSearchResultsItem.hidden { - display: none; - } - - #zpSearchResultsPaging:before, - #zpSearchResultsPaging:after { - content: ""; - display: table; - } - #zpSearchResultsPaging:after { - clear: both; - } - #zpSearchResultsPaging span.title { - display: block; - float: left; - font-weight: bold; - margin: 2px; margin-left: 0; - padding: 0.5em 1em 0.5em 0; - text-transform: uppercase; - } - #zpSearchResultsPaging a { - border: none; - display: block; - float: left; - margin: 2px; - padding: 0.5em 1em; - text-decoration: none; - } - #zpSearchResultsPaging a.selected { - border: 2px solid #000; - margin: 0; - } - - /* END OF BROWSE LIB */ - \ No newline at end of file +div.zp-Zotpress { + /* Modified to fit with WP 2020 theme */ + margin-top: 0; + margin-bottom: 1em; + /* margin: 0 0 1em; */ +} +div.zp-Zotpress div.zp-List.loading { + background: transparent url('../images/loading_default.gif') no-repeat center bottom; + padding-bottom: 21px; + min-height: 2em; +} + +/* Thanks to http://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/ */ +div.zp-Zotpress a { + -ms-word-break: break-all; + word-break: break-all; + word-break: break-word; + -webkit-hyphens: auto; + -moz-hyphens: auto; + hyphens: auto; +} + +div.zp-Zotpress div.zp-Entry.zp-HasImage { + clear: both; +} +div.zp-Zotpress div.zp-Entry-Image { + float: right; +} + +a.zp-CiteRIS, +a.zp-DownloadURL { + font-size: 0.8em; + text-transform: uppercase; +} +a.zp-CiteRIS:before, +a.zp-DownloadURL:before { + content: "("; +} +a.zp-CiteRIS:after, +a.zp-DownloadURL:after { + content: ")"; +} + +.zp-List p.hide { + display: none; +} + +.zp-Info { + background: #ffeaa7 url('../images/icon-64x64.png') no-repeat top 0.4em right 0.4em; + background-size: auto 2em; + border: 1px solid #fdcb6e; + padding: 0.5em; + padding-right: 3em; +} + + +/* In-Text Citations */ + +.zp-ZotpressShortcode.cite .summary, +.zp-ZotpressShortcode.bib .summary { + display: none; +} + +.zp-InText-Citation.loading { + background: transparent url('../images/loading_default.gif') no-repeat center; + background-size: contain; + display: inline-block; + margin: 0 !important; + width: 1em; + height: 1em; +} + +/* END OF BASIC SHORTCODES */ + + + +/* START OF BROWSE LIB */ + +.zp-Browse-Bar { + background-color: #fff; + border: 2px solid #000; +} +.zp-Browse-Bar:before, +.zp-Browse-Bar:after { + content: ""; + display: table; +} +.zp-Browse-Bar:after { + clear: both; +} + +.zp-Browse-Collections, +.zp-Browse-Tags { + float: left; + width: 50%; +} + +.zp-Browse-Select { + overflow: hidden; + width: 100%; + /* height: 34px; */ +} +.zp-Browse-Select select { + background: transparent; + border: none; + color: #000; + cursor: pointer; + font-size: 1em; + margin: 0; + padding: 0 0.5em; + width: 100%; + height: 34px; +} +.zp-Browse-Collections-Select { + border-right: 2px solid #000; +} + +.zp-Collection-Title { + letter-spacing: 0.15em; + font-size: 0.9em; + font-weight: bold; + margin: 3em 0 0 0; + padding: 0 0 2em; + text-transform: uppercase; +} + +.zp-Entry-Image { + float: right; + margin: 0 0 1em 1em; +} + +.zp-Zotpress-SearchBox .zp-SearchBy-Container { + border-top: 1px solid #ccc; + display: flex; + justify-content: flex-start; + align-items: center; + padding: 0.5em 0; +} +.zp-Zotpress-SearchBox .zpSearchFilterContainer { + display: flex; + justify-content: space-evenly; + align-items: center; + margin: 0 0.5em; +} +.zp-Zotpress-SearchBox input[type="radio"] { + cursor: pointer; + margin: 0 0.5em 0 0; + vertical-align: middle; +} +.zp-Zotpress-SearchBox label { + cursor: pointer; + margin: 0; +} +.zp-Zotpress-SearchBox .zp-SearchBy { + margin: 0 1.5em; +} +.zp-Zotpress-SearchBox label, +.zp-Zotpress-SearchBox .zp-SearchBy { + font-size: 0.5em; + letter-spacing: 0.1em; + text-transform: uppercase; +} + +.zpSearchLoading { + visibility: hidden; + display: block; + margin: 1em auto; +} +.zpSearchLoading.show { + visibility: visible; +} + +.zpSearchResultsItem:after { + clear: both; + content: ""; + display: table; +} + +.zpSearchResultsItem .item_key { + display: block; + font-weight: bold; + margin-bottom: 2em; +} + +.zpSearchResultsItem.hidden { + display: none; +} + +.zp-Zotpress-SearchBox-Input { + border: none; + width: 100%; +} + +.zpSearchResultsPagingContainer { + display: none; + margin: 2rem 0; +} + +.zpSearchResultsPagingContainer:before, +.zpSearchResultsPagingContainer:after { + content: ""; + display: table; +} +.zpSearchResultsPagingContainer:after { + clear: both; +} +.zpSearchResultsPagingContainerInner { + display: flex; + align-items: center; + justify-content: flex-start; +} +.zpSearchResultsPagingContainer span.title { + /* display: block; */ + /* float: left; */ + font-size: 0.8em; + font-weight: bold; + line-height: 2.6; + margin-right: 2rem; + /* margin: 2px; */ + /* margin-left: 0; */ + /* padding: 0 20px 0; */ + text-transform: uppercase; +} + +.zpSearchResultsPagingCrop { + position: relative; + /* float: left; */ + overflow: hidden; + width: calc(3.5rem * 5); + /* width: 13em; */ + height: 3.5rem; +} + +.zpSearchResultsPaging { + /* z-index: 0; */ + position: absolute; + top: 0; + left: 0; + /* height: inherit; */ + display: flex; +} + +.zpSearchResultsPaging a, +.zpSearchResultsPaging a:link { + display: block; + /* float: left; */ + line-height: 0.9; + margin: 0; + text-align: center; + text-decoration: none; + flex-shrink: 0; + /* width: 50px; */ + width: 3.5rem; +} +.zpSearchResultsPaging a:focus { + box-shadow: none; + outline: none; +} +.zpSearchResultsPaging a span { + border: 2px solid transparent; + display: block; + padding: calc(1rem - 4px) calc(1.2rem - 4px); +} +.zpSearchResultsPaging a.selected span { + border-color: #000; +} + +.zpSearchResultsPagingScroller { + /* float: left; */ + /* background-color: #fff; */ + margin-left: 2rem; + text-align: center; + /* width: 4.2em; */ + /* height: 3rem; */ +} +.zpSearchResultsPagingScroller span { + cursor: pointer; + display: inline-block; + font-size: 3.5rem; + line-height: 0.8; + /* padding: 5px 10px; */ + padding: 0 1rem; + + -webkit-user-select: none; /* Chrome all / Safari all */ + -moz-user-select: none; /* Firefox all */ + -ms-user-select: none; /* IE 10+ */ + user-select: none; +} +.zpSearchResultsPagingScroller span:active { + opacity: 0.2; +} + + +div.zp-List .zp_display_progress { + background: transparent url('../images/loading_default.gif') no-repeat center left; + font-size: 0.7em; + line-height: 2; + padding-left: 3em; + text-transform: uppercase; +} +div.zp-List .csl-left-margin { + text-align: left; + width: 2.5em !important; +} +div.zp-List .csl-right-inline { + margin-left: 2.75em !important; +} + +.ui-helper-hidden-accessible { + display: none; +} + +/* END OF BROWSE LIB */ diff --git a/css/zotpress.shortcode.min.css b/css/zotpress.shortcode.min.css new file mode 100644 index 0000000..9acb3f8 --- /dev/null +++ b/css/zotpress.shortcode.min.css @@ -0,0 +1 @@ +div.zp-Zotpress{margin-top:0;margin-bottom:1em}div.zp-Zotpress div.zp-List.loading{background:transparent url('../images/loading_default.gif') no-repeat center bottom;padding-bottom:21px;min-height:2em}div.zp-Zotpress a{-ms-word-break:break-all;word-break:break-all;word-break:break-word;-webkit-hyphens:auto;-moz-hyphens:auto;hyphens:auto}div.zp-Zotpress div.zp-Entry.zp-HasImage{clear:both}div.zp-Zotpress div.zp-Entry-Image{float:right}a.zp-CiteRIS,a.zp-DownloadURL{font-size:.8em;text-transform:uppercase}a.zp-CiteRIS:before,a.zp-DownloadURL:before{content:"("}a.zp-CiteRIS:after,a.zp-DownloadURL:after{content:")"}.zp-List p.hide{display:none}.zp-Info{background:#ffeaa7 url('../images/icon-64x64.png') no-repeat top .4em right .4em;background-size:auto 2em;border:1px solid #fdcb6e;padding:.5em;padding-right:3em}.zp-ZotpressShortcode.bib .summary,.zp-ZotpressShortcode.cite .summary{display:none}.zp-InText-Citation.loading{background:transparent url('../images/loading_default.gif') no-repeat center;background-size:contain;display:inline-block;margin:0!important;width:1em;height:1em}.zp-Browse-Bar{background-color:#fff;border:2px solid #000}.zp-Browse-Bar:after,.zp-Browse-Bar:before{content:"";display:table}.zp-Browse-Bar:after{clear:both}.zp-Browse-Collections,.zp-Browse-Tags{float:left;width:50%}.zp-Browse-Select{overflow:hidden;width:100%}.zp-Browse-Select select{background:0 0;border:none;color:#000;cursor:pointer;font-size:1em;margin:0;padding:0 .5em;width:100%;height:34px}.zp-Browse-Collections-Select{border-right:2px solid #000}.zp-Collection-Title{letter-spacing:.15em;font-size:.9em;font-weight:700;margin:3em 0 0 0;padding:0 0 2em;text-transform:uppercase}.zp-Entry-Image{float:right;margin:0 0 1em 1em}.zp-Zotpress-SearchBox .zp-SearchBy-Container{border-top:1px solid #ccc;display:flex;justify-content:flex-start;align-items:center;padding:.5em 0}.zp-Zotpress-SearchBox .zpSearchFilterContainer{display:flex;justify-content:space-evenly;align-items:center;margin:0 .5em}.zp-Zotpress-SearchBox input[type=radio]{cursor:pointer;margin:0 .5em 0 0;vertical-align:middle}.zp-Zotpress-SearchBox label{cursor:pointer;margin:0}.zp-Zotpress-SearchBox .zp-SearchBy{margin:0 1.5em}.zp-Zotpress-SearchBox .zp-SearchBy,.zp-Zotpress-SearchBox label{font-size:.5em;letter-spacing:.1em;text-transform:uppercase}.zpSearchLoading{visibility:hidden;display:block;margin:1em auto}.zpSearchLoading.show{visibility:visible}.zpSearchResultsItem:after{clear:both;content:"";display:table}.zpSearchResultsItem .item_key{display:block;font-weight:700;margin-bottom:2em}.zpSearchResultsItem.hidden{display:none}.zp-Zotpress-SearchBox-Input{border:none;width:100%}.zpSearchResultsPagingContainer{display:none;margin:2rem 0}.zpSearchResultsPagingContainer:after,.zpSearchResultsPagingContainer:before{content:"";display:table}.zpSearchResultsPagingContainer:after{clear:both}.zpSearchResultsPagingContainerInner{display:flex;align-items:center;justify-content:flex-start}.zpSearchResultsPagingContainer span.title{font-size:.8em;font-weight:700;line-height:2.6;margin-right:2rem;text-transform:uppercase}.zpSearchResultsPagingCrop{position:relative;overflow:hidden;width:calc(3.5rem * 5);height:3.5rem}.zpSearchResultsPaging{position:absolute;top:0;left:0;display:flex}.zpSearchResultsPaging a,.zpSearchResultsPaging a:link{display:block;line-height:.9;margin:0;text-align:center;text-decoration:none;flex-shrink:0;width:3.5rem}.zpSearchResultsPaging a:focus{box-shadow:none;outline:0}.zpSearchResultsPaging a span{border:2px solid transparent;display:block;padding:calc(1rem - 4px) calc(1.2rem - 4px)}.zpSearchResultsPaging a.selected span{border-color:#000}.zpSearchResultsPagingScroller{margin-left:2rem;text-align:center}.zpSearchResultsPagingScroller span{cursor:pointer;display:inline-block;font-size:3.5rem;line-height:.8;padding:0 1rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.zpSearchResultsPagingScroller span:active{opacity:.2}div.zp-List .zp_display_progress{background:transparent url('../images/loading_default.gif') no-repeat center left;font-size:.7em;line-height:2;padding-left:3em;text-transform:uppercase}div.zp-List .csl-left-margin{text-align:left;width:2.5em!important}div.zp-List .csl-right-inline{margin-left:2.75em!important}.ui-helper-hidden-accessible{display:none} diff --git a/eb-mods/eb-mods.php b/eb-mods/eb-mods.php new file mode 100644 index 0000000..2b90b8c --- /dev/null +++ b/eb-mods/eb-mods.php @@ -0,0 +1,84 @@ +prepare("SELECT * FROM ".$wpdb->prefix."zotpress WHERE api_user_id = %d", $api_user_id); + } + else { + $query = $wpdb->prepare("SELECT * FROM ".$wpdb->prefix."zotpress WHERE nickname = %s", $nickname); + } + } + else { + $query = "SELECT * FROM ".$wpdb->prefix."zotpress ORDER BY id DESC LIMIT 1"; + } + $zp_account = $wpdb->get_row($query); + + set_transient($hash, $zp_account); + } + + return $zp_account; +} + +function eb_zotpress_refresh_account($api_user_id = false, $nickname = false) { + $hash = 'zotpress_api_user_'.$api_user_id.$nickname; + + delete_transient($hash); +} + + +function eb_zotpress_get_cache($request_id, $api_user_id) { + global $wpdb; + + $cache_ver = get_option('zotpress_cache_ver_user_'.$api_user_id, 1); + $hash = 'zotpress_cache_'.md5($request_id.$api_user_id.$cache_ver); + + $zp_account = get_transient($hash); + if($zp_account === false) { + $zp_account = $wpdb->get_results($wpdb->prepare( + "SELECT DISTINCT ".$wpdb->prefix."zotpress_cache.* + FROM ".$wpdb->prefix."zotpress_cache + WHERE ".$wpdb->prefix."zotpress_cache.request_id = %s + AND ".$wpdb->prefix."zotpress_cache.api_user_id = %d", + $request_id, $api_user_id + )); + + set_transient($hash, $zp_account); + } + + return $zp_account; +} + +function eb_zotpress_refresh_cache($request_id, $api_user_id) { + $cache_ver = get_option('zotpress_cache_ver_user_'.$api_user_id, 1); + $hash = 'zotpress_cache_'.md5($request_id.$api_user_id.$cache_ver); + + delete_transient($hash); +} + + +function eb_zotpress_escape_array($arr) { + global $wpdb; + $escaped = array(); + foreach($arr as $k => $v){ + $v = trim($v); + if(!$v) + continue; + + if(is_numeric($v)) + $escaped[] = $wpdb->prepare('%d', $v); + else + $escaped[] = $wpdb->prepare('%s', $v); + } + return implode(',', $escaped); +} + +add_action( 'plugins_loaded', 'eb_zotpress_remove_filters' ); +function eb_zotpress_remove_filters() { + remove_filter( 'http_request_timeout', 'Zotpress_change_timeout' ); +} \ No newline at end of file diff --git a/images/bullet.gif b/images/bullet.gif deleted file mode 100644 index 9ff1fb2..0000000 Binary files a/images/bullet.gif and /dev/null differ diff --git a/images/help.png b/images/help.png deleted file mode 100644 index da1889e..0000000 Binary files a/images/help.png and /dev/null differ diff --git a/images/icon-64x64.png b/images/icon-64x64.png new file mode 100644 index 0000000..9ae9e43 Binary files /dev/null and b/images/icon-64x64.png differ diff --git a/images/icon-add.png b/images/icon-add.png deleted file mode 100644 index 3b425a8..0000000 Binary files a/images/icon-add.png and /dev/null differ diff --git a/images/icon-bib.png b/images/icon-bib.png deleted file mode 100644 index 5e3a7aa..0000000 Binary files a/images/icon-bib.png and /dev/null differ diff --git a/images/icon-cite.png b/images/icon-cite.png deleted file mode 100644 index b3479c6..0000000 Binary files a/images/icon-cite.png and /dev/null differ diff --git a/images/icon-edit.png b/images/icon-edit.png deleted file mode 100644 index 1305387..0000000 Binary files a/images/icon-edit.png and /dev/null differ diff --git a/images/icon-list.png b/images/icon-list.png deleted file mode 100644 index 6b7c191..0000000 Binary files a/images/icon-list.png and /dev/null differ diff --git a/images/icon-menu.svg b/images/icon-menu.svg new file mode 100644 index 0000000..c3b58cf --- /dev/null +++ b/images/icon-menu.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/images/loading_import.GIF b/images/loading_import.gif similarity index 100% rename from images/loading_import.GIF rename to images/loading_import.gif diff --git a/images/loading_import_lg.gif b/images/loading_import_lg.gif deleted file mode 100644 index c49f4d8..0000000 Binary files a/images/loading_import_lg.gif and /dev/null differ diff --git a/images/loading_list.gif b/images/loading_list.gif deleted file mode 100644 index bce8e07..0000000 Binary files a/images/loading_list.gif and /dev/null differ diff --git a/images/loading_select.gif b/images/loading_select.gif deleted file mode 100644 index ec34d55..0000000 Binary files a/images/loading_select.gif and /dev/null differ diff --git a/images/pp.png b/images/pp.png new file mode 100644 index 0000000..2900df7 Binary files /dev/null and b/images/pp.png differ diff --git a/images/sprite.png b/images/sprite.png index 24e24cb..ae35f90 100644 Binary files a/images/sprite.png and b/images/sprite.png differ diff --git a/images/syncing_bw.gif b/images/syncing_bw.gif deleted file mode 100644 index 0443387..0000000 Binary files a/images/syncing_bw.gif and /dev/null differ diff --git a/js/jquery.livequery.js b/js/jquery.livequery.js deleted file mode 100644 index dde8ad8..0000000 --- a/js/jquery.livequery.js +++ /dev/null @@ -1,250 +0,0 @@ -/*! Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * - * Version: 1.0.3 - * Requires jQuery 1.1.3+ - * Docs: http://docs.jquery.com/Plugins/livequery - */ - -(function($) { - -$.extend($.fn, { - livequery: function(type, fn, fn2) { - var self = this, q; - - // Handle different call patterns - if ($.isFunction(type)) - fn2 = fn, fn = type, type = undefined; - - // See if Live Query already exists - $.each( $.livequery.queries, function(i, query) { - if ( self.selector == query.selector && self.context == query.context && - type == query.type && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) ) - // Found the query, exit the each loop - return (q = query) && false; - }); - - // Create new Live Query if it wasn't found - q = q || new $.livequery(this.selector, this.context, type, fn, fn2); - - // Make sure it is running - q.stopped = false; - - // Run it immediately for the first time - q.run(); - - // Contnue the chain - return this; - }, - - expire: function(type, fn, fn2) { - var self = this; - - // Handle different call patterns - if ($.isFunction(type)) - fn2 = fn, fn = type, type = undefined; - - // Find the Live Query based on arguments and stop it - $.each( $.livequery.queries, function(i, query) { - if ( self.selector == query.selector && self.context == query.context && - (!type || type == query.type) && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) && !this.stopped ) - $.livequery.stop(query.id); - }); - - // Continue the chain - return this; - } -}); - -$.livequery = function(selector, context, type, fn, fn2) { - this.selector = selector; - this.context = context || document; - this.type = type; - this.fn = fn; - this.fn2 = fn2; - this.elements = []; - this.stopped = false; - - // The id is the index of the Live Query in $.livequery.queries - this.id = $.livequery.queries.push(this)-1; - - // Mark the functions for matching later on - fn.$lqguid = fn.$lqguid || $.livequery.guid++; - if (fn2) fn2.$lqguid = fn2.$lqguid || $.livequery.guid++; - - // Return the Live Query - return this; -}; - -$.livequery.prototype = { - stop: function() { - var query = this; - - if ( this.type ) - // Unbind all bound events - this.elements.unbind(this.type, this.fn); - else if (this.fn2) - // Call the second function for all matched elements - this.elements.each(function(i, el) { - query.fn2.apply(el); - }); - - // Clear out matched elements - this.elements = []; - - // Stop the Live Query from running until restarted - this.stopped = true; - }, - - run: function() { - // Short-circuit if stopped - if ( this.stopped ) return; - var query = this; - - var oEls = this.elements, - els = $(this.selector, this.context), - nEls = els.not(oEls); - - // Set elements to the latest set of matched elements - this.elements = els; - - if (this.type) { - // Bind events to newly matched elements - nEls.bind(this.type, this.fn); - - // Unbind events to elements no longer matched - if (oEls.length > 0) - $.each(oEls, function(i, el) { - if ( $.inArray(el, els) < 0 ) - $.event.remove(el, query.type, query.fn); - }); - } - else { - // Call the first function for newly matched elements - nEls.each(function() { - query.fn.apply(this); - }); - - // Call the second function for elements no longer matched - if ( this.fn2 && oEls.length > 0 ) - $.each(oEls, function(i, el) { - if ( $.inArray(el, els) < 0 ) - query.fn2.apply(el); - }); - } - } -}; - -$.extend($.livequery, { - guid: 0, - queries: [], - queue: [], - running: false, - timeout: null, - - checkQueue: function() { - if ( $.livequery.running && $.livequery.queue.length ) { - var length = $.livequery.queue.length; - // Run each Live Query currently in the queue - while ( length-- ) - $.livequery.queries[ $.livequery.queue.shift() ].run(); - } - }, - - pause: function() { - // Don't run anymore Live Queries until restarted - $.livequery.running = false; - }, - - play: function() { - // Restart Live Queries - $.livequery.running = true; - // Request a run of the Live Queries - $.livequery.run(); - }, - - registerPlugin: function() { - $.each( arguments, function(i,n) { - // Short-circuit if the method doesn't exist - if (!$.fn[n]) return; - - // Save a reference to the original method - var old = $.fn[n]; - - // Create a new method - $.fn[n] = function() { - // Call the original method - var r = old.apply(this, arguments); - - // Request a run of the Live Queries - $.livequery.run(); - - // Return the original methods result - return r; - } - }); - }, - - run: function(id) { - if (id != undefined) { - // Put the particular Live Query in the queue if it doesn't already exist - if ( $.inArray(id, $.livequery.queue) < 0 ) - $.livequery.queue.push( id ); - } - else - // Put each Live Query in the queue if it doesn't already exist - $.each( $.livequery.queries, function(id) { - if ( $.inArray(id, $.livequery.queue) < 0 ) - $.livequery.queue.push( id ); - }); - - // Clear timeout if it already exists - if ($.livequery.timeout) clearTimeout($.livequery.timeout); - // Create a timeout to check the queue and actually run the Live Queries - $.livequery.timeout = setTimeout($.livequery.checkQueue, 20); - }, - - stop: function(id) { - if (id != undefined) - // Stop are particular Live Query - $.livequery.queries[ id ].stop(); - else - // Stop all Live Queries - $.each( $.livequery.queries, function(id) { - $.livequery.queries[ id ].stop(); - }); - } -}); - -// Register core DOM manipulation methods -$.livequery.registerPlugin('append', 'prepend', 'after', 'before', 'wrap', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'empty', 'remove'); - -// Run Live Queries when the Document is ready -$(function() { $.livequery.play(); }); - - -// Save a reference to the original init method -var init = $.prototype.init; - -// Create a new init method that exposes two new properties: selector and context -$.prototype.init = function(a,c) { - // Call the original init and save the result - var r = init.apply(this, arguments); - - // Copy over properties if they exist already - if (a && a.selector) - r.context = a.context, r.selector = a.selector; - - // Set properties - if ( typeof a == 'string' ) - r.context = c || document, r.selector = a; - - // Return the result - return r; -}; - -// Give the init function the jQuery prototype for later instantiation (needed after Rev 4091) -$.prototype.init.prototype = $.prototype; - -})(jQuery); \ No newline at end of file diff --git a/js/zotpress.accounts.js b/js/zotpress.accounts.js deleted file mode 100644 index dc27960..0000000 --- a/js/zotpress.accounts.js +++ /dev/null @@ -1,347 +0,0 @@ -jQuery(document).ready( function() -{ - - - /* - - SETUP BUTTONS - - */ - - jQuery("input#zp-Zotpress-Setup-Options-Next").click(function() - { - window.parent.location = "admin.php?page=Zotpress&setup=true&setupstep=three"; - return false; - }); - - jQuery("input#zp-Zotpress-Setup-Options-Complete").click(function() - { - if ( jQuery(this).hasClass("import") ) - window.parent.location = "admin.php?page=Zotpress"; - else - window.parent.location = "admin.php?page=Zotpress&accounts=true"; - return false; - }); - - - - /* - - SYNC ACCOUNT WITH ZOTPRESS - - */ - - jQuery('#zp-Connect').click(function () - { - var data = 'connect=true' - + '&account_type=' + jQuery('select[name=account_type] option:selected').val() - + '&api_user_id=' + jQuery('input[name=api_user_id]').val() - + '&public_key=' + jQuery('input[name=public_key]').val() - + '&nickname=' + escape(jQuery('input[name=nickname]').val()); - - // Disable all the text fields - jQuery('input[name!=update], textarea, select').attr('disabled','true'); - - // Show the loading sign - jQuery('.zp-Errors').hide(); - jQuery('.zp-Success').hide(); - jQuery('.zp-Loading').show(); - - // Set up uri - var xmlUri = jQuery('input[name=ZOTPRESS_PLUGIN_URL]').val() + 'lib/actions/actions.php?'+data; - - if (jQuery('input[name=update]').val() !== undefined) - xmlUri += "&update=" + jQuery('input[name=update]').val(); - - // AJAX - jQuery.get(xmlUri, {}, function(xml) - { - var $result = jQuery('result', xml).attr('success'); - - if ($result == "true") - { - jQuery('div.zp-Errors').hide(); - jQuery('.zp-Loading').hide(); - jQuery('div.zp-Success').html("
Success! Your Zotero account has been validated.
\n"); - - jQuery('div.zp-Success').show(); - - // SETUP - if (jQuery("div#zp-Setup").length > 0) - { - jQuery.doTimeout(1000,function() { - window.parent.location = "admin.php?page=Zotpress&setup=true&setupstep=two"; - }); - } - - // REGULAR - else - { - jQuery.doTimeout(1000,function() - { - jQuery('div#zp-AddAccount').slideUp("fast"); - jQuery('form#zp-Add')[0].reset(); - jQuery('input[name!=update], textarea, select').removeAttr('disabled'); - jQuery('div.zp-Success').hide(); - - DisplayAccounts(); - }); - } - } - else // Show errors - { - jQuery('input, textarea, select').removeAttr('disabled'); - jQuery('div.zp-Errors').html("Oops! "+jQuery('errors', xml).text()+"
\n"); - jQuery('div.zp-Errors').show(); - jQuery('.zp-Loading').hide(); - } - }); - - return false; - }); - - - - /* - - OAUTH MODAL - - */ - - jQuery('a.zp-OAuth-Button').livequery('click', function() { - tb_show('', jQuery(this).attr('href')+'&TB_iframe=true'); - return false; - }); - - - - - /* - - REMOVE ACCOUNT - - */ - - jQuery('#zp-Accounts').delegate(".actions a.delete", "click", function () { - - $this = jQuery(this); - $thisProject = $this.parent().parent(); - - var confirmDelete = confirm("Are you sure you want to remove this account?"); - - if (confirmDelete==true) - { - var xmlUri = jQuery('#ZOTPRESS_PLUGIN_URL').text() + 'lib/actions/actions.php?delete=' + $this.attr("href").replace("#", ""); - - jQuery.get(xmlUri, {}, function(xml) - { - if ( jQuery('result', xml).attr('success') == "true" ) - { - if ( jQuery('result', xml).attr('total_accounts') == 0 ) - window.location = 'admin.php?page=Zotpress'; - else - window.location = 'admin.php?page=Zotpress&accounts=true'; - } - else - { - alert( "Sorry - couldn't delete that account." ); - } - }); - } - - }); - - - - /* - - SET UP IMPORT BUTTON - - */ - - jQuery("iframe#zp-Setup-Import").ready(function() - { - jQuery("input#zp-Zotpress-Setup-Import").removeAttr('disabled'); - jQuery("input.zp-Import-Button").removeAttr('disabled'); - - // IMPORT ITEMS - jQuery("input#zp-Zotpress-Setup-Import-Items").click(function() - { - jQuery(".import .zp-Loading-Initial").show(); - jQuery(".import .zp-Import-Messages").show(); - jQuery("input[type=button]").attr('disabled', 'true'); - - jQuery("iframe#zp-Setup-Import").attr('src', jQuery("iframe#zp-Setup-Import").attr('src') + "&go=true&step=items&singlestep=true"); - - return false; - }); - - // IMPORT COLLECTIONS - jQuery("input#zp-Zotpress-Setup-Import-Collections").click(function() - { - jQuery(".import .zp-Loading-Initial").show(); - jQuery(".import .zp-Import-Messages").text("Importing collections 1-50 ...").show(); - jQuery("input[type=button]").attr('disabled', 'true'); - - jQuery("iframe#zp-Setup-Import").attr('src', jQuery("iframe#zp-Setup-Import").attr('src') + "&go=true&step=collections&singlestep=true"); - - return false; - }); - - // IMPORT TAGS - jQuery("input#zp-Zotpress-Setup-Import-Tags").click(function() - { - jQuery(".import .zp-Loading-Initial").show(); - jQuery(".import .zp-Import-Messages").text("Importing tags 1-50 ...").show(); - jQuery("input[type=button]").attr('disabled', 'true'); - - jQuery("iframe#zp-Setup-Import").attr('src', jQuery("iframe#zp-Setup-Import").attr('src') + "&go=true&step=tags&singlestep=true"); - - return false; - }); - - // IMPORT EVERYTHING - jQuery("input#zp-Zotpress-Setup-Import").click(function() - { - jQuery(".import .zp-Loading-Initial").show(); - jQuery(".import .zp-Import-Messages").show(); - jQuery("input[type=button]").attr('disabled', 'true'); - - jQuery("iframe#zp-Setup-Import").attr('src', jQuery("iframe#zp-Setup-Import").attr('src') + "&go=true&step=items"); - - return false; - }); - }); - - - - /* - - SET UP SYNC BUTTON - - */ - - //jQuery('div#zp-AccountsList div.zp-Account .actions a.sync').click(function(e) - //{ - // var $this = jQuery(this); - // - // // Disable sync link until done - // e.preventDefault(); - // - // // Prep and show loading sign - // $this.removeClass("success"); - // $this.removeClass("error"); - // $this.addClass("syncing"); - // - // // Add sync iframe to DOM - // if (jQuery("iframe#zp-Sync-" + jQuery("span", $this).text()).length == 0) - // { - // jQuery('', { - // id: 'zp-Sync-' + jQuery('span.api_user_id', $this.parent().parent()).text(), - // 'class': 'zp-Setup-Sync', // IE ISSUE - needs quotations around class - // //src: jQuery('#ZOTPRESS_PLUGIN_URL').text() + 'lib/import/sync.php?api_user_id=' + $this.attr("rel") + '&key=' + jQuery("span#ZOTPRESS_PASSCODE").text() + '&step=items', - // src: jQuery('#ZOTPRESS_PLUGIN_URL').text() + 'lib/import/sync.php?api_user_id=' + $this.attr("rel") + '&step=items', - // scrolling: 'yes' - // }).appendTo('#zp-ManageAccounts'); - // } - // else - // { - // jQuery("iframe#zp-Sync-" + jQuery("span", $this).text()).attr("src", jQuery('#ZOTPRESS_PLUGIN_URL').text() + 'lib/import/sync.php?api_user_id=' + $this.attr("rel") + '&key=' + jQuery("span", $this).text() + '&step=items'); - // } - // - // $this.parent().find('.zp-Sync-Messages').text("Syncing items 1-50 ..."); - // - // return false; - //}); - - - - - /* - - SELECTIVE IMPORT BY COLLECTION - - */ - - jQuery("iframe#zp-Step-Import-Collection-Frame").on("load", function() - { - jQuery("#zp-Step-Import-Collection").removeClass("loading"); - jQuery("#zp-Step-Import-Collection, iframe#zp-Step-Import-Collection-Frame").animate({ height: jQuery("iframe#zp-Step-Import-Collection-Frame").contents().find(".zp-Collection-List").outerHeight() + "px"}, 0); - jQuery("input#zp-Zotpress-Setup-Import-Selective").removeAttr('disabled'); - }); - - jQuery("#zp-Zotpress-Setup-Import-Selective").click(function () - { - if ( jQuery("#zp-Step-Import-Collection-Frame").contents().find(".zp-Collection.selected").length > 0 ) - { - var zpSelectedCollections = ""; - - jQuery("#zp-Step-Import-Collection-Frame").contents().find(".zp-Collection.selected").each( function() - { - zpSelectedCollections += jQuery(this).attr("rel") + ","; - }); - - zpSelectedCollections = zpSelectedCollections.slice(0, - 1); - - jQuery(".selective.zp-Loading-Initial").show(); - jQuery(".selective.zp-Import-Messages").text("Importing items 1-50 ....").show(); - jQuery(this).attr('disabled', 'true'); - - jQuery("iframe#zp-Setup-Import").attr('src', jQuery("iframe#zp-Setup-Import").attr('src') + "&go=true&step=selective&collections=" + zpSelectedCollections); - - return false; - } - else - { - alert ("Please select at least one collection to import."); return false; - } - }); - - - - - // SET DEFAULT ACCOUNT - - jQuery(".zp-Accounts-Default").click(function() - { - var $this = jQuery(this); - - // Plunk it together - var data = 'submit=true&account=' + $this.attr("rel"); - - // Prep for data validation - $this.addClass("loading"); - - // Set up uri - var xmlUri = jQuery('#ZOTPRESS_PLUGIN_URL').text() + 'lib/widget/widget.metabox.actions.php?'+data; - - // AJAX - jQuery.get(xmlUri, {}, function(xml) - { - var $result = jQuery('result', xml).attr('success'); - - $this.removeClass("success loading"); - - if ($result == "true") - { - $this.addClass("success"); - jQuery(".zp-Accounts-Default").parent().removeClass("selected"); - - jQuery.doTimeout(1000,function() { - $this.removeClass("success"); - $this.parent().addClass("selected"); - }); - } - else // Show errors - { - alert(jQuery('errors', xml).text()); - } - }); - - // Cancel default behaviours - return false; - - }); - - -}); \ No newline at end of file diff --git a/js/zotpress.admin.js b/js/zotpress.admin.js new file mode 100644 index 0000000..699177e --- /dev/null +++ b/js/zotpress.admin.js @@ -0,0 +1,836 @@ +jQuery(document).ready( function() +{ + + + /* + + NAVIGATION STYLES + + */ + + jQuery("div#zp-Zotpress div#zp-Zotpress-Navigation a.nav-item").click( function() { + jQuery(this).addClass("active"); + }); + + + + /* + + DISMISS ADMIN NOTIFICATIONS + + */ + + jQuery(".Zotpress_update_notice .notice-dismiss.text").click( function() + { + jQuery(".Zotpress_update_notice").slideUp("fast"); + }); + + /* + + COPYING ITEM KEYS ON CLICK + + */ + + jQuery('.zp-Entry-ID-Text span').click( function() { + jQuery(this).parent().find('input').show().select(); + jQuery(this).hide(); + }); + jQuery('.zp-Entry-ID-Text input').blur( function() { + jQuery(this).hide(); + jQuery(this).parent().find('span').show(); + }); + + + + /* + + FILTER CITATIONS + + */ + + // FILTER BY ACCOUNT + + jQuery('div.zp-Browse-Accounts').delegate("select#zp-FilterByAccount", "change", function() + { + var id = jQuery(this).val(); + + jQuery(this).addClass("loading"); + jQuery(".zp-Browse-Account-Options a").addClass("disabled").unbind("click", + function (e) { + e.preventDefault(); + return false; + } + ); + + window.location = "admin.php?page=Zotpress&api_user_id="+id; + }); + + + /* + + CITATION IMAGE HOVER + + */ + + jQuery('div.zp-List').delegate("div.zp-Entry-Image", "mouseenter mouseleave", function () { + jQuery(this).toggleClass("hover"); + }); + + + /* + + SETUP PAGE "COMPLETE" BUTTON + + */ + + jQuery("input#zp-Zotpress-Setup-Options-Complete").click(function() + { + window.parent.location = "admin.php?page=Zotpress&accounts=true"; + + return false; + }); + + + + /* + + SYNC ACCOUNT WITH ZOTPRESS + + */ + + jQuery('#zp-Connect').click(function () + { + + // Disable all the text fields + jQuery('input[name!=update], textarea, select').attr('disabled','true'); + + // Show the loading sign + jQuery('.zp-Errors').hide(); + jQuery('.zp-Success').hide(); + jQuery('.zp-Loading').show(); + + jQuery.ajax( + { + url: zpAccountsAJAX.ajaxurl, + data: { + 'action': 'zpAccountsViaAJAX', + 'action_type': 'add_account', + 'account_type': jQuery('select[name=account_type] option:selected').val(), + 'api_user_id': jQuery('input[name=api_user_id]').val(), + 'public_key': jQuery('input[name=public_key]').val(), + 'nickname': escape(jQuery('input[name=nickname]').val()), + 'zpAccountsAJAX_nonce': zpAccountsAJAX.zpAccountsAJAX_nonce + }, + xhrFields: { + withCredentials: true + }, + success: function(xml) + { + var $result = jQuery('result', xml).attr('success'); + + if ($result == "true") + { + jQuery('div.zp-Errors').hide(); + jQuery('.zp-Loading').hide(); + jQuery('div.zp-Success').html(""+zpAccountsAJAX.txt_success+"! "+zpAccountsAJAX.txt_accvalid+"
\n"); + + jQuery('div.zp-Success').show(); + + // SETUP + if (jQuery("div#zp-Setup").length > 0) + { + jQuery.doTimeout(1000,function() { + window.parent.location = "admin.php?page=Zotpress&setup=true&setupstep=two"; + }); + } + + // REGULAR + else + { + jQuery.doTimeout(1000,function() + { + jQuery('div#zp-AddAccount').slideUp("fast"); + jQuery('form#zp-Add')[0].reset(); + jQuery('input[name!=update], textarea, select').removeAttr('disabled'); + jQuery('div.zp-Success').hide(); + + DisplayAccounts(); + }); + } + } + else // Show errors + { + jQuery('input, textarea, select').removeAttr('disabled'); + jQuery('div.zp-Errors').html(""+zpAccountsAJAX.txt_oops+" "+jQuery('errors', xml).text()+"
\n"); + jQuery('div.zp-Errors').show(); + jQuery('.zp-Loading').hide(); + } + }, + error: function(errorThrown) + { + console.log(errorThrown); + } + }); + + return false; + }); + + + + /* + + REMOVE ACCOUNT + + */ + + jQuery('#zp-Accounts').delegate("a.delete", "click", function () + { + $this = jQuery(this); + $thisProject = $this.parent().parent(); + + var confirmDelete = confirm(zpAccountsAJAX.txt_sureremove); + + if (confirmDelete==true) + { + jQuery.ajax( + { + url: zpAccountsAJAX.ajaxurl, + data: { + 'action': 'zpAccountsViaAJAX', + 'action_type': 'delete_account', + 'api_user_id': $this.attr("href").replace("#", ""), + 'zpAccountsAJAX_nonce': zpAccountsAJAX.zpAccountsAJAX_nonce + }, + xhrFields: { + withCredentials: true + }, + success: function(xml) + { + if ( jQuery('result', xml).attr('success') == "true" ) + { + if ( jQuery('result', xml).attr('total_accounts') == 0 ) + window.location = 'admin.php?page=Zotpress'; + else + window.location = 'admin.php?page=Zotpress&accounts=true'; + } + else + { + alert( "Sorry - couldn't delete that account." ); + } + }, + error: function(errorThrown) + { + console.log(errorThrown); + } + }); + } + + return false; + }); + + + + /* + + CLEAR ACCOUNT CACHE + + */ + + jQuery('#zp-Accounts').delegate("a.cache", "click", function () + { + $this = jQuery(this); + $thisProject = $this.parent().parent(); + + var confirmClearCache = confirm(zpAccountsAJAX.txt_surecache); + + if (confirmClearCache==true) + { + // Show loading + $this.removeClass("dashicons-image-rotate") + .addClass("loading"); + + // Clear the cache + jQuery.ajax( + { + url: zpAccountsAJAX.ajaxurl, + data: { + 'action': 'zpAccountsViaAJAX', + 'action_type': 'clear_cache', + 'api_user_id': $this.attr("href").replace("#", ""), + 'zpAccountsAJAX_nonce': zpAccountsAJAX.zpAccountsAJAX_nonce + }, + xhrFields: { + withCredentials: true + }, + complete: function() + { + // Always remove loading sign + $this.removeClass("loading") + .addClass("dashicons-image-rotate"); + }, + success: function(xml) + { + if ( jQuery('result', xml).attr('success') == "true" ) + { + // alert( zpAccountsAJAX.txt_cachecleared ); + jQuery("#zp-ManageAccounts").prepend(""+zpAccountsAJAX.txt_cachecleared+"
"+jQuery('errors', xml).text()+"
\n"); + jQuery('#zp-Zotpress-Options-Account div.zp-Errors').show(); + } + } + + else + { + $this.removeClass("success loading"); + + if ($result == "true") + { + jQuery(".zp-Account-Default") + .removeClass("dashicons-star-filled") + .addClass("dashicons-star-empty"); + + $this.removeClass("dashicons-star-empty") + .addClass("dashicons-star-filled"); + + if ( $this.hasClass("zp-Account-Default") ) + $this.addClass("disabled") + .text( zpAccountsAJAX.txt_default ); + } + else // Show errors + { + alert(jQuery('errors', xml).text()); + } + } + }, + error: function(errorThrown) + { + console.log(errorThrown); + } + }); + + // Cancel default behaviours + return false; + + }); + } + } + + + + + + /* + + SET STYLE + + */ + + if ( jQuery("select#zp-Zotpress-Options-Style").length > 0 ) + { + // Show/hide add style input + jQuery("#zp-Zotpress-Options-Style").change(function() + { + if (this.value === 'new-style') + { + jQuery("#zp-Zotpress-Options-Style-New-Container").show(); + } + else + { + jQuery("#zp-Zotpress-Options-Style-New-Container").hide(); + jQuery("#zp-Zotpress-Options-Style-New").val(""); + } + }); + + + jQuery("#zp-Zotpress-Options-Style-Button").click(function() + { + var $this = jQuery(this); + var updateStyleList = false; + + // Prep for data validation + $this.addClass("loading"); + + // Determine if using existing or adding new + // If adding new, also update Zotpress_StyleList option + var styleOption = jQuery('select#zp-Zotpress-Options-Style').val(); + if ( styleOption == "new-style" ) + { + styleOption = jQuery("#zp-Zotpress-Options-Style-New").val(); + updateStyleList = true; + } + + if ( styleOption != "" ) + { + // Prep for data validation + jQuery(this).attr('disabled','true'); + jQuery('#zp-Zotpress-Options-Style-Container .zp-Loading').show(); + + // AJAX + jQuery.ajax( + { + url: zpAccountsAJAX.ajaxurl, + data: { + 'action': 'zpAccountsViaAJAX', + 'action_type': 'default_style', + 'style': styleOption, + 'zpAccountsAJAX_nonce': zpAccountsAJAX.zpAccountsAJAX_nonce + }, + xhrFields: { + withCredentials: true + }, + success: function(xml) + { + var $result = jQuery('result', xml).attr('success'); + + jQuery('input#zp-Zotpress-Options-Style-Button').removeAttr('disabled'); + jQuery('#zp-Zotpress-Options-Style-Container .zp-Loading').hide(); + + if ($result == "true") + { + jQuery('#zp-Zotpress-Options-Style-Container div.zp-Errors').hide(); + jQuery('#zp-Zotpress-Options-Style-Container div.zp-Success').show(); + + jQuery.doTimeout(1000,function() + { + jQuery('#zp-Zotpress-Options-Style-Container div.zp-Success').hide(); + + if (updateStyleList === true) + { + jQuery('#zp-Zotpress-Options-Style').prepend(jQuery("", { + value: styleOption, + text: styleOption, + selected: "selected" + })); + + jQuery("#zp-Zotpress-Options-Style-New-Container").hide(); + jQuery("#zp-Zotpress-Options-Style-New").val(""); + } + }); + } + else // Show errors + { + jQuery('#zp-Zotpress-Options-Style-Container div.zp-Errors').html(jQuery('errors', xml).text()+"\n"); + jQuery('#zp-Zotpress-Options-Style-Container div.zp-Errors').show(); + } + }, + error: function(errorThrown) + { + console.log(errorThrown); + } + }); + } + else // Show errors + { + jQuery('#zp-Zotpress-Options-Style-Container div.zp-Errors').html("No style was entered.\n"); + jQuery('#zp-Zotpress-Options-Style-Container div.zp-Errors').show(); + } + + // Cancel default behaviours + return false; + + }); + } + + + + + + + + + /* + + SET REFERENCE WIDGET FOR CPT'S + + */ + + jQuery("#zp-Zotpress-Options-CPT-Button").click(function() + { + var $this = jQuery(this); + + // Determine if using existing or adding new + // If adding new, also update Zotpress_StyleList option + // Get all post types + var zpTempCPT = ""; + jQuery("input[name='zp-CTP']:checked").each( function() { + zpTempCPT = zpTempCPT + "," + jQuery(this).val(); + }); + + if ( zpTempCPT != "" ) + { + // Prep for data validation + jQuery(this).attr('disabled','true'); + jQuery('#zp-Zotpress-Options-CPT .zp-Loading').show(); + + // AJAX + jQuery.ajax( + { + url: zpAccountsAJAX.ajaxurl, + data: { + 'action': 'zpAccountsViaAJAX', + 'action_type': 'ref_widget_cpt', + 'cpt': zpTempCPT, + 'zpAccountsAJAX_nonce': zpAccountsAJAX.zpAccountsAJAX_nonce + }, + xhrFields: { + withCredentials: true + }, + success: function(xml) + { + var $result = jQuery('result', xml).attr('success'); + + jQuery('#zp-Zotpress-Options-CPT .zp-Loading').hide(); + jQuery('input#zp-Zotpress-Options-CPT-Button').removeAttr('disabled'); + + if ($result == "true") + { + jQuery('#zp-Zotpress-Options-CPT div.zp-Errors').hide(); + jQuery('#zp-Zotpress-Options-CPT div.zp-Success').show(); + + jQuery.doTimeout(1000,function() { + jQuery('#zp-Zotpress-Options-CPT div.zp-Success').hide(); + }); + } + else // Show errors + { + jQuery('#zp-Zotpress-Options-CPT div.zp-Errors').html(""+jQuery('errors', xml).text()+"
\n"); + jQuery('#zp-Zotpress-Options-CPT div.zp-Errors').show(); + } + }, + error: function(errorThrown) + { + console.log(errorThrown); + } + }); + } + else // Show errors + { + jQuery('#zp-Zotpress-Options-CPT div.zp-Errors').html("No content type was selected.\n"); + jQuery('#zp-Zotpress-Options-CPT div.zp-Errors').show(); + } + + // Cancel default behaviours + return false; + + }); + + + + /* + + RESET ZOTPRESS + + */ + + jQuery("#zp-Zotpress-Options-Reset-Button").click(function() + { + var $this = jQuery(this); + + var confirmDelete = confirm(zpAccountsAJAX.txt_surereset); + + if ( confirmDelete == true ) + { + // Prep for data validation + jQuery(this).attr( 'disabled', 'true' ); + jQuery('#zp-Zotpress-Options-Reset .zp-Loading').show(); + + // Prep for data validation + jQuery(this).attr('disabled','true'); + jQuery('#zp-Zotpress-Options-Reset .zp-Loading').show(); + + // AJAX + jQuery.ajax( + { + url: zpAccountsAJAX.ajaxurl, + data: { + 'action': 'zpAccountsViaAJAX', + 'action_type': 'reset', + 'reset': "true", + 'zpAccountsAJAX_nonce': zpAccountsAJAX.zpAccountsAJAX_nonce + }, + xhrFields: { + withCredentials: true + }, + success: function(xml) + { + var $result = jQuery('result', xml).attr('success'); + + jQuery('#zp-Zotpress-Options-Reset .zp-Loading').hide(); + jQuery('input#zp-Zotpress-Options-Reset-Button').removeAttr('disabled'); + + if ($result == "true") + { + jQuery('#zp-Zotpress-Options-Reset div.zp-Errors').hide(); + jQuery('#zp-Zotpress-Options-Reset div.zp-Success').show(); + + jQuery.doTimeout(1000,function() { + jQuery('#zp-Zotpress-Options-Reset div.zp-Success').hide(); + window.parent.location = "admin.php?page=Zotpress"; + }); + } + else // Show errors + { + jQuery('#zp-Zotpress-Options-Reset div.zp-Errors').html(""+jQuery('errors', xml).text()+"
\n"); + jQuery('#zp-Zotpress-Options-Reset div.zp-Errors').show(); + } + }, + error: function(errorThrown) + { + console.log(errorThrown); + } + }); + } + + // Cancel default behaviours + return false; + + }); + + + + /* + + ADD/UPDATE ITEM IMAGE + + */ + + var zp_uploader; + + jQuery(".zp-List").on("click", ".zp-Entry-Image a.upload", function(e) + { + e.preventDefault(); + + $this = jQuery(this); + + if (zp_uploader) + { + zp_uploader.open(); + return; + } + + zp_uploader = wp.media.frames.file_frame = wp.media( + { + title: zpAccountsAJAX.txt_chooseimg, + button: { + text: zpAccountsAJAX.txt_chooseimg + }, + multiple: false + }); + + zp_uploader.on( 'select', function() + { + attachment = zp_uploader.state().get('selection').first().toJSON(); + + // Save as featured image + jQuery.ajax( + { + url: zpAccountsAJAX.ajaxurl, + data: { + 'action': 'zpAccountsViaAJAX', + 'action_type': 'add_image', + 'api_user_id': jQuery(".ZP_API_USER_ID").text(), + 'item_key': $this.attr('rel'), + 'image_id': attachment.id, + 'zpAccountsAJAX_nonce': zpAccountsAJAX.zpAccountsAJAX_nonce + }, + success: function(xml) + { + var $result = jQuery('result', xml).attr('success'); + + if ( $result == "true" ) + { + console.log("zp: Found image to set."); + + // NOTE: Sometimes WP doesn't provide a thumbnail, just full + // Maybe because some images are so small they are thumbnail-sized + + var thumbURL = ""; + if ( attachment.sizes.hasOwnProperty("thumbnail") ) + thumbURL = attachment.sizes.thumbnail.url; + else if ( attachment.sizes.hasOwnProperty("full") ) + thumbURL = attachment.sizes.full.url; + + if ( $this.parent().find(".thumb").length > 0 ) // update existing + { + $this.parent().find(".thumb").attr("src", thumbURL); + } + else // set image + { + $this.parent().addClass("hasImage"); + $this.parent().prepend(""+zpAccountsAJAX.txt_success+"! "+zpAccountsAJAX.txt_accvalid+"
\n"),jQuery("div.zp-Success").show(),jQuery("div#zp-Setup").length>0?jQuery.doTimeout(1e3,function(){window.parent.location="admin.php?page=Zotpress&setup=true&setupstep=two"}):jQuery.doTimeout(1e3,function(){jQuery("div#zp-AddAccount").slideUp("fast"),jQuery("form#zp-Add")[0].reset(),jQuery("input[name!=update], textarea, select").removeAttr("disabled"),jQuery("div.zp-Success").hide(),DisplayAccounts()})):(jQuery("input, textarea, select").removeAttr("disabled"),jQuery("div.zp-Errors").html(""+zpAccountsAJAX.txt_oops+" "+jQuery("errors",e).text()+"
\n"),jQuery("div.zp-Errors").show(),jQuery(".zp-Loading").hide())},error:function(e){console.log(e)}}),!1}),jQuery("#zp-Accounts").delegate("a.delete","click",function(){return $this=jQuery(this),$thisProject=$this.parent().parent(),1==confirm(zpAccountsAJAX.txt_sureremove)&&jQuery.ajax({url:zpAccountsAJAX.ajaxurl,data:{action:"zpAccountsViaAJAX",action_type:"delete_account",api_user_id:$this.attr("href").replace("#",""),zpAccountsAJAX_nonce:zpAccountsAJAX.zpAccountsAJAX_nonce},xhrFields:{withCredentials:!0},success:function(e){"true"==jQuery("result",e).attr("success")?0==jQuery("result",e).attr("total_accounts")?window.location="admin.php?page=Zotpress":window.location="admin.php?page=Zotpress&accounts=true":alert("Sorry - couldn't delete that account.")},error:function(e){console.log(e)}}),!1}),jQuery("#zp-Accounts").delegate("a.cache","click",function(){return $this=jQuery(this),$thisProject=$this.parent().parent(),1==confirm(zpAccountsAJAX.txt_surecache)&&($this.removeClass("dashicons-image-rotate").addClass("loading"),jQuery.ajax({url:zpAccountsAJAX.ajaxurl,data:{action:"zpAccountsViaAJAX",action_type:"clear_cache",api_user_id:$this.attr("href").replace("#",""),zpAccountsAJAX_nonce:zpAccountsAJAX.zpAccountsAJAX_nonce},xhrFields:{withCredentials:!0},complete:function(){$this.removeClass("loading").addClass("dashicons-image-rotate")},success:function(e){"true"==jQuery("result",e).attr("success")?(jQuery("#zp-ManageAccounts").prepend(""+zpAccountsAJAX.txt_cachecleared+"
"+jQuery("errors",s).text()+"
\n"),jQuery("#zp-Zotpress-Options-Account div.zp-Errors").show())):(e.removeClass("success loading"),"true"==r?(jQuery(".zp-Account-Default").removeClass("dashicons-star-filled").addClass("dashicons-star-empty"),e.removeClass("dashicons-star-empty").addClass("dashicons-star-filled"),e.hasClass("zp-Account-Default")&&e.addClass("disabled").text(zpAccountsAJAX.txt_default)):alert(jQuery("errors",s).text()))},error:function(e){console.log(e)}}),!1})),jQuery("select#zp-Zotpress-Options-Style").length>0&&(jQuery("#zp-Zotpress-Options-Style").change(function(){"new-style"===this.value?jQuery("#zp-Zotpress-Options-Style-New-Container").show():(jQuery("#zp-Zotpress-Options-Style-New-Container").hide(),jQuery("#zp-Zotpress-Options-Style-New").val(""))}),jQuery("#zp-Zotpress-Options-Style-Button").click(function(){var e=jQuery(this),t=!1;e.addClass("loading");var s=jQuery("select#zp-Zotpress-Options-Style").val();return"new-style"==s&&(s=jQuery("#zp-Zotpress-Options-Style-New").val(),t=!0),""!=s?(jQuery(this).attr("disabled","true"),jQuery("#zp-Zotpress-Options-Style-Container .zp-Loading").show(),jQuery.ajax({url:zpAccountsAJAX.ajaxurl,data:{action:"zpAccountsViaAJAX",action_type:"default_style",style:s,zpAccountsAJAX_nonce:zpAccountsAJAX.zpAccountsAJAX_nonce},xhrFields:{withCredentials:!0},success:function(e){var r=jQuery("result",e).attr("success");jQuery("input#zp-Zotpress-Options-Style-Button").removeAttr("disabled"),jQuery("#zp-Zotpress-Options-Style-Container .zp-Loading").hide(),"true"==r?(jQuery("#zp-Zotpress-Options-Style-Container div.zp-Errors").hide(),jQuery("#zp-Zotpress-Options-Style-Container div.zp-Success").show(),jQuery.doTimeout(1e3,function(){jQuery("#zp-Zotpress-Options-Style-Container div.zp-Success").hide(),!0===t&&(jQuery("#zp-Zotpress-Options-Style").prepend(jQuery("",{value:s,text:s,selected:"selected"})),jQuery("#zp-Zotpress-Options-Style-New-Container").hide(),jQuery("#zp-Zotpress-Options-Style-New").val(""))})):(jQuery("#zp-Zotpress-Options-Style-Container div.zp-Errors").html(jQuery("errors",e).text()+"\n"),jQuery("#zp-Zotpress-Options-Style-Container div.zp-Errors").show())},error:function(e){console.log(e)}})):(jQuery("#zp-Zotpress-Options-Style-Container div.zp-Errors").html("No style was entered.\n"),jQuery("#zp-Zotpress-Options-Style-Container div.zp-Errors").show()),!1})),jQuery("#zp-Zotpress-Options-CPT-Button").click(function(){jQuery(this);var e="";return jQuery("input[name='zp-CTP']:checked").each(function(){e=e+","+jQuery(this).val()}),""!=e?(jQuery(this).attr("disabled","true"),jQuery("#zp-Zotpress-Options-CPT .zp-Loading").show(),jQuery.ajax({url:zpAccountsAJAX.ajaxurl,data:{action:"zpAccountsViaAJAX",action_type:"ref_widget_cpt",cpt:e,zpAccountsAJAX_nonce:zpAccountsAJAX.zpAccountsAJAX_nonce},xhrFields:{withCredentials:!0},success:function(e){var t=jQuery("result",e).attr("success");jQuery("#zp-Zotpress-Options-CPT .zp-Loading").hide(),jQuery("input#zp-Zotpress-Options-CPT-Button").removeAttr("disabled"),"true"==t?(jQuery("#zp-Zotpress-Options-CPT div.zp-Errors").hide(),jQuery("#zp-Zotpress-Options-CPT div.zp-Success").show(),jQuery.doTimeout(1e3,function(){jQuery("#zp-Zotpress-Options-CPT div.zp-Success").hide()})):(jQuery("#zp-Zotpress-Options-CPT div.zp-Errors").html(""+jQuery("errors",e).text()+"
\n"),jQuery("#zp-Zotpress-Options-CPT div.zp-Errors").show())},error:function(e){console.log(e)}})):(jQuery("#zp-Zotpress-Options-CPT div.zp-Errors").html("No content type was selected.\n"),jQuery("#zp-Zotpress-Options-CPT div.zp-Errors").show()),!1}),jQuery("#zp-Zotpress-Options-Reset-Button").click(function(){jQuery(this);return 1==confirm(zpAccountsAJAX.txt_surereset)&&(jQuery(this).attr("disabled","true"),jQuery("#zp-Zotpress-Options-Reset .zp-Loading").show(),jQuery(this).attr("disabled","true"),jQuery("#zp-Zotpress-Options-Reset .zp-Loading").show(),jQuery.ajax({url:zpAccountsAJAX.ajaxurl,data:{action:"zpAccountsViaAJAX",action_type:"reset",reset:"true",zpAccountsAJAX_nonce:zpAccountsAJAX.zpAccountsAJAX_nonce},xhrFields:{withCredentials:!0},success:function(e){var t=jQuery("result",e).attr("success");jQuery("#zp-Zotpress-Options-Reset .zp-Loading").hide(),jQuery("input#zp-Zotpress-Options-Reset-Button").removeAttr("disabled"),"true"==t?(jQuery("#zp-Zotpress-Options-Reset div.zp-Errors").hide(),jQuery("#zp-Zotpress-Options-Reset div.zp-Success").show(),jQuery.doTimeout(1e3,function(){jQuery("#zp-Zotpress-Options-Reset div.zp-Success").hide(),window.parent.location="admin.php?page=Zotpress"})):(jQuery("#zp-Zotpress-Options-Reset div.zp-Errors").html(""+jQuery("errors",e).text()+"
\n"),jQuery("#zp-Zotpress-Options-Reset div.zp-Errors").show())},error:function(e){console.log(e)}})),!1}),jQuery(".zp-List").on("click",".zp-Entry-Image a.upload",function(t){t.preventDefault(),$this=jQuery(this),e?e.open():((e=wp.media.frames.file_frame=wp.media({title:zpAccountsAJAX.txt_chooseimg,button:{text:zpAccountsAJAX.txt_chooseimg},multiple:!1})).on("select",function(){attachment=e.state().get("selection").first().toJSON(),jQuery.ajax({url:zpAccountsAJAX.ajaxurl,data:{action:"zpAccountsViaAJAX",action_type:"add_image",api_user_id:jQuery(".ZP_API_USER_ID").text(),item_key:$this.attr("rel"),image_id:attachment.id,zpAccountsAJAX_nonce:zpAccountsAJAX.zpAccountsAJAX_nonce},success:function(e){if("true"==jQuery("result",e).attr("success")){console.log("zp: Found image to set.");var t="";attachment.sizes.hasOwnProperty("thumbnail")?t=attachment.sizes.thumbnail.url:attachment.sizes.hasOwnProperty("full")&&(t=attachment.sizes.full.url),$this.parent().find(".thumb").length>0?$this.parent().find(".thumb").attr("src",t):($this.parent().addClass("hasImage"),$this.parent().prepend("" + zp_current_list_items[jQuery(this).attr("key")][3] + "
\n"; - jQuery(".zp-ID-" + thisAPIUserID + "-" + jQuery(this).attr("key"), $this).append( temp ); - } - }); - - // Update numbered lists - zpCorrectOrderedList( $this ); - - // Or, number the list, if forced - zpForceNumber ( $this ); - } - //else // Show errors - //{ - // alert("error - can't update citation styles"); // DEBUGGING - //} - }); - } // zp_update_style - - else // If style doesn't change, possibly do other things - { - // Like numbering the list by force - zpForceNumber ( $this ); - } - }); - - - - /* - - HIGHLIGHT ENTRY ON JUMP - - */ - - jQuery(".zp-ZotpressInText").click( function() - { - $this = jQuery(this); - - // Get item key from e.g. #zp-256-S74KCIJR - var zpBibItemKey = $this.attr("href").slice( $this.attr("href").lastIndexOf("-")+1, $this.attr("href").length ); - - // Highlight bibliography item with that key - jQuery(".zp-ID-" + thisAPIUserID + "-" +zpBibItemKey).effect("highlight", { color: "#C5EFF7", easing: "easeInExpo" }, 1200); - }); - - -}); \ No newline at end of file diff --git a/js/zotpress.gutenberg.js b/js/zotpress.gutenberg.js new file mode 100644 index 0000000..2881036 --- /dev/null +++ b/js/zotpress.gutenberg.js @@ -0,0 +1,122 @@ +jQuery(document).ready( function() +{ + ( function( wp ) { + + // + // Editor toolbar button + // + var ZotpressBibButton = function( props ) { + return wp.element.createElement( + + wp.blockEditor.RichTextToolbarButton, { + icon: 'shortcode', + title: 'Zotpress Shortcode', + onClick: function() + { + console.log( 'zp: Zotpress bib shortcode' ); + + // Clear the previous search list + zpClearSearch(); + + // Modal with shortcode generator; + // grab the legacy metabox from the Page sidebar + jQuery("#zp-ZotpressMetaBox") + .addClass("zp-ShortcodeBuilder") + .appendTo(".interface-interface-skeleton__body") + .find(".zp-ZotpressMetaBox-Insert-Button").text( zpTranslate.txt_insertsc ); + + // Focus on search input + jQuery("#zp-ZotpressMetaBox") + .find("#zp-ZotpressMetaBox-Search-Input").focus(); + + // + // Shortcode buttons + // + + jQuery(".zp-ZotpressMetaBox-Insert-Button") + .click( function() + { + zpInsertShortcode( jQuery(this), props ); + } + ); + }, + isActive: props.isActive, + } + ); + } + + // + // We're using Format Type to insert shortcodes + // + wp.richText.registerFormatType( + 'zotpress-gutenberg/bib', { + title: 'Insert Zotpress Shortcode', + tagName: 'span', + className: 'zp-InText-Citation-Container', + edit: ZotpressBibButton, + } + ); + + // + // Insert shortcode depending on type + // + function zpInsertShortcode( $scButton, props ) + { + // Generate the shortcode + var zpBiblioShortcode = window.zpGenerateShortcodeString( $scButton.data("sctype") ); + console.log(zpBiblioShortcode); + + // Create the shortcode string + let shortcodeRichText = wp.richText.create({ + // TODO: When making it like Word ... + // ... can re-add the HTML ... + // ... and change the HTML view display + // to something more meaningful, like + // "Okorafor (2021)" for in-text ... + // html: ''+zpBiblioShortcode+'' + html: zpBiblioShortcode, + }); + + // Insert it + props.onChange( + wp.richText.insert( + props.value, + shortcodeRichText, // content + props.value.start, + props.value.end, + ) + ); + + // Close the modal, put the metabox back + jQuery("#zp-ZotpressMetaBox") + .removeClass("zp-ShortcodeBuilder") + .appendTo("#ZotpressMetaBox .inside") + .find(".zp-ZotpressMetaBox-Insert-Button").text( zpTranslate.txt_insertsc ); + + } // zpInsertShortcode() + + // + // Exit button + // + jQuery("#zp-ShortcodeBuilder-Close").click( + function() + { + jQuery("#zp-ZotpressMetaBox") + .removeClass("zp-ShortcodeBuilder") + .appendTo("#ZotpressMetaBox .inside"); + } + ); + + // + // Clear the search list + // + function zpClearSearch() + { + jQuery(".zp-ZotpressMetaBox-Insert-Button").off("click"); + window.zpRefItems = []; + jQuery("#zp-ZotpressMetaBox-List .item").remove(); + + } // zpClearSearch() + + } )( window.wp ); +}); diff --git a/js/zotpress.gutenberg.min.js b/js/zotpress.gutenberg.min.js new file mode 100644 index 0000000..c7a8283 --- /dev/null +++ b/js/zotpress.gutenberg.min.js @@ -0,0 +1,3 @@ +jQuery(document).ready(function(){(function(wp){var ZotpressBibButton=function(props){return wp.element.createElement(wp.blockEditor.RichTextToolbarButton,{icon:'shortcode',title:'Zotpress Shortcode',onClick:function(){console.log('zp: Zotpress bib shortcode');zpClearSearch();jQuery("#zp-ZotpressMetaBox").addClass("zp-ShortcodeBuilder").appendTo(".interface-interface-skeleton__body").find(".zp-ZotpressMetaBox-Insert-Button").text(zpTranslate.txt_insertsc);jQuery("#zp-ZotpressMetaBox").find("#zp-ZotpressMetaBox-Search-Input").focus();jQuery(".zp-ZotpressMetaBox-Insert-Button").click(function(){zpInsertShortcode(jQuery(this),props)})},isActive:props.isActive,})} +wp.richText.registerFormatType('zotpress-gutenberg/bib',{title:'Insert Zotpress Shortcode',tagName:'span',className:'zp-InText-Citation-Container',edit:ZotpressBibButton,});function zpInsertShortcode($scButton,props){var zpBiblioShortcode=window.zpGenerateShortcodeString($scButton.data("sctype"));console.log(zpBiblioShortcode);let shortcodeRichText=wp.richText.create({html:zpBiblioShortcode,});props.onChange(wp.richText.insert(props.value,shortcodeRichText,props.value.start,props.value.end,));jQuery("#zp-ZotpressMetaBox").removeClass("zp-ShortcodeBuilder").appendTo("#ZotpressMetaBox .inside").find(".zp-ZotpressMetaBox-Insert-Button").text(zpTranslate.txt_insertsc)} +jQuery("#zp-ShortcodeBuilder-Close").click(function(){jQuery("#zp-ZotpressMetaBox").removeClass("zp-ShortcodeBuilder").appendTo("#ZotpressMetaBox .inside")});function zpClearSearch(){jQuery(".zp-ZotpressMetaBox-Insert-Button").off("click");window.zpRefItems=[];jQuery("#zp-ZotpressMetaBox-List .item").remove()}})(window.wp)}) diff --git a/js/zotpress.help.js b/js/zotpress.help.js new file mode 100644 index 0000000..3e85025 --- /dev/null +++ b/js/zotpress.help.js @@ -0,0 +1,77 @@ +jQuery(document).ready(function() +{ + + /**************************************************************************************** + * + * ZOTPRESS HELP + * + ****************************************************************************************/ + + if ( jQuery("#zp-Zotero-API").length > 0 ) + { + jQuery("#zp-Zotero-API").tabs(); + + jQuery('.zp-Tab-Link').click( function(e) + { + e.preventDefault(); + + jQuery("#zp-Zotero-API").tabs( + "option", + "active", + jQuery( jQuery(this).attr("href"), jQuery("#zp-Zotero-API")).index()-1 + ); + + jQuery("html,body").animate({ + scrollTop: jQuery("#zp-Zotero-API-Hash").offset().top + }, 500); + }); + } + + + if ( jQuery("input.zp-Zotero-API-Attributes-Search-Input").length > 0 ) + { + jQuery("input.zp-Zotero-API-Attributes-Search-Input").each( function() + { + var $searchInput = jQuery(this); + var $searchParent = $searchInput.parent().parent().parent(); + + $searchInput + .bind( "keydown", function( event ) + { + // Don't submit the form when pressing enter + if ( event.keyCode === 13 ) { + event.preventDefault(); + } + + // Otherwise, show loading icon and hide search icon + jQuery("#zp-Zotero-API .ui-tabs-panel[aria-hidden=false] .zp-Zotero-API-Attributes-Search-Status .dashicons").hide(); + jQuery("#zp-Zotero-API .ui-tabs-panel[aria-hidden=false] .zp-Zotero-API-Attributes-Search-Status .zp-Loading").show(); + + }) + .bind( "keyup", function( event ) + { + // Hide loading and show search + jQuery("#zp-Zotero-API .ui-tabs-panel[aria-hidden=false] .zp-Zotero-API-Attributes-Search-Status .zp-Loading").hide(); + jQuery("#zp-Zotero-API .ui-tabs-panel[aria-hidden=false] .zp-Zotero-API-Attributes-Search-Status .dashicons").show(); + + // Only search if 3+ characters + if ( $searchInput.val().length >= 3 ) + { + jQuery(".zp-Zotero-API-Attribute", $searchParent).each( function() + { + var tempkey = String( jQuery(this).data("keywords") ); + + if ( tempkey.indexOf($searchInput.val()) == -1 ) + jQuery(this).hide(); + else + jQuery(this).show(); + }); + } + else // Show everything + { + jQuery(".zp-Zotero-API-Attribute", $searchParent).show(); + } + }); + }); + } +}); \ No newline at end of file diff --git a/js/zotpress.help.min.js b/js/zotpress.help.min.js new file mode 100644 index 0000000..3a479fe --- /dev/null +++ b/js/zotpress.help.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(){jQuery("#zp-Zotero-API").length>0&&(jQuery("#zp-Zotero-API").tabs(),jQuery(".zp-Tab-Link").click(function(e){e.preventDefault(),jQuery("#zp-Zotero-API").tabs("option","active",jQuery(jQuery(this).attr("href"),jQuery("#zp-Zotero-API")).index()-1),jQuery("html,body").animate({scrollTop:jQuery("#zp-Zotero-API-Hash").offset().top},500)})),jQuery("input.zp-Zotero-API-Attributes-Search-Input").length>0&&jQuery("input.zp-Zotero-API-Attributes-Search-Input").each(function(){var e=jQuery(this),t=e.parent().parent().parent();e.bind("keydown",function(e){13===e.keyCode&&e.preventDefault(),jQuery("#zp-Zotero-API .ui-tabs-panel[aria-hidden=false] .zp-Zotero-API-Attributes-Search-Status .dashicons").hide(),jQuery("#zp-Zotero-API .ui-tabs-panel[aria-hidden=false] .zp-Zotero-API-Attributes-Search-Status .zp-Loading").show()}).bind("keyup",function(r){jQuery("#zp-Zotero-API .ui-tabs-panel[aria-hidden=false] .zp-Zotero-API-Attributes-Search-Status .zp-Loading").hide(),jQuery("#zp-Zotero-API .ui-tabs-panel[aria-hidden=false] .zp-Zotero-API-Attributes-Search-Status .dashicons").show(),e.val().length>=3?jQuery(".zp-Zotero-API-Attribute",t).each(function(){-1==String(jQuery(this).data("keywords")).indexOf(e.val())?jQuery(this).hide():jQuery(this).show()}):jQuery(".zp-Zotero-API-Attribute",t).show()})})}); \ No newline at end of file diff --git a/js/zotpress.icon.js b/js/zotpress.icon.js new file mode 100644 index 0000000..de5c989 --- /dev/null +++ b/js/zotpress.icon.js @@ -0,0 +1,7 @@ +const icons = {}; + +icons.zotpress = + +// icons.zotpress = + +export default icons; diff --git a/js/zotpress.lib.dropdown.js b/js/zotpress.lib.dropdown.js new file mode 100644 index 0000000..386cc36 --- /dev/null +++ b/js/zotpress.lib.dropdown.js @@ -0,0 +1,576 @@ +jQuery(document).ready(function() +{ + /////////////////////////////////////////////// + // + // ZOTPRESS LIBRARY DROPDOWN + // + /////////////////////////////////////////////// + + // TODO: notes, abstract + + // if ( jQuery(".zp-Browse-Collections-Select").length > 0 ) + if ( jQuery(".zp-Browse").length > 0 ) + { + // Go through each instance + // jQuery(".zp-Browse").each( function(l) + for (let l = 0; l < window.zpBrowseList.length; ++l) + { + // var zpThisLib = jQuery(".zp-Browse-Collections-Select", jQuery(this)).parents().eq(3); // zp-Browse + // var zpThisLib = jQuery(this); // zp-Browse + var zpThisLib = jQuery("#"+window.zpBrowseList[l].id); // zp-Browse + + var zpThisLibProps = { + 'zpCollectionId' : false, + 'zpTagId' : false, + 'zpShowTags' : false, + 'zpShowImages' : false, + 'zpIsAdmin' : false, + 'zpTarget' : false, + 'zpTopLevel' : false, + 'zpURLWrap' : false, + 'zpItemsFlag' : true + }; + + if ( jQuery(".ZP_COLLECTION_ID", zpThisLib).length > 0 ) zpThisLibProps.zpCollectionId = jQuery(".ZP_COLLECTION_ID", zpThisLib).text(); + if ( jQuery(".ZP_TAG_ID", zpThisLib).length > 0 ) zpThisLibProps.zpTagId = jQuery(".ZP_TAG_ID", zpThisLib).text(); + if ( jQuery(".ZP_SHOWTAGS").length > 0 && parseInt( jQuery(".ZP_SHOWTAGS").text() ) == "1" ) zpThisLibProps.zpShowTags = true; + if ( jQuery(".ZP_SHOWIMAGE", zpThisLib).length > 0 && ( jQuery(".ZP_SHOWIMAGE", zpThisLib).text() == "yes" || jQuery(".ZP_SHOWIMAGE", zpThisLib).text() == "true" || jQuery(".ZP_SHOWIMAGE", zpThisLib).text() == "1" ) ) zpThisLibProps.zpShowImages = true; + if ( jQuery(".ZP_ISADMIN", zpThisLib).length > 0 ) zpThisLibProps.zpIsAdmin = true; + if ( jQuery(".ZP_TARGET", zpThisLib).length > 0 && jQuery(".ZP_TARGET").text().length > 0 ) zpThisLibProps.zpTarget = true; + if ( jQuery(".ZP_TOPLEVEL", zpThisLib).length > 0 ) + { + zpThisLibProps.zpTopLevel = jQuery(".ZP_TOPLEVEL", zpThisLib).text(); + + if ( zpThisLibProps.zpCollectionId === false + && zpThisLibProps.zpTagId === false ) + zpThisLibProps.zpCollectionId = zpThisLibProps.zpTopLevel; + } + if ( jQuery(".ZP_URLWRAP", zpThisLib).length > 0 ) zpThisLibProps.zpURLWrap = jQuery(".ZP_URLWRAP", zpThisLib).text(); + + // Handle no browse bar + var browsebar = true; if ( jQuery(".ZP_BROWSEBAR", zpThisLib).text() == "" ) browsebar = false; + + if ( browsebar ) + { + zplib_get_collections ( l, zpThisLibProps, zpThisLib, 0, 0, false ); + zplib_get_tags ( l, zpThisLibProps, zpThisLib, 0, 0, false ); + } + + // Otherwise, get items + zplib_get_items ( l, zpThisLibProps, zpThisLib, 0, 0, false ); + + // }); // each + } + } // Zotpress DropDown Library + + + // Corrects numeric citations + function zp_relabel_numbers(zpThisLib) + { + if ( jQuery("div.zp-List .csl-left-margin", zpThisLib).length != 0 + && /\d/.test( jQuery("div.zp-List .csl-left-margin", zpThisLib).text() ) ) + { + var count = 1; + + jQuery("div.zp-List .csl-left-margin", zpThisLib).each(function() + { + jQuery(this).text( jQuery(this).text().replace(/(\d+)/, count) ); + count++; + }); + } + } + + // Get list of collections + function zplib_get_collections ( l, zpThisLibProps, zpThisLib, request_start, request_last, update ) + { + // Set parameter defaults + if ( typeof(request_start) === "undefined" || request_start == "false" || request_start == "" ) + request_start = 0; + + if ( typeof(request_last) === "undefined" || request_last == "false" || request_last == "" ) + request_last = 0; + + jQuery.ajax( + { + url: zpShortcodeAJAX.ajaxurl, + ifModified: true, + data: { + 'action': 'zpRetrieveViaShortcode', + 'api_user_id': jQuery(".ZP_API_USER_ID", zpThisLib).text(), + 'item_type': 'collections', + 'collection_id': zpThisLibProps.zpCollectionId, + 'request_start': request_start, + 'request_last': request_last, + 'sortby': 'title', + 'get_top': true, + 'update': update, + 'zpShortcode_nonce': zpShortcodeAJAX.zpShortcode_nonce + }, + xhrFields: { + withCredentials: true + }, + success: function(data) + { + var zp_collections = jQuery.parseJSON( data ); + var zp_collection_options = ""; + + // Remove cached bib before adding updates + // REVIEW: Is adding used_cache necessary? + if ( update === false ) jQuery("select.zp-Browse-Collections-Select", zpThisLib).addClass("used_cache"); + if ( update === true && ! jQuery("select.zp-Browse-Collections-Select", zpThisLib).hasClass("updating") ) + { + jQuery("select.zp-Browse-Collections-Select", zpThisLib).find('*').not('.blank').remove(); + jQuery("select.zp-Browse-Collections-Select", zpThisLib).addClass("updating"); + + if ( zpThisLibProps.zpTagId ) + jQuery("select.zp-Browse-Collections-Select", zpThisLib) + .append( "" ); + // if ( ! zpTagId && ! zpCollectionId ) jQuery("select.zp-Browse-Collections-Select", zpThisLib).append( "" ); + } + + // Add Top Level Collection option to the select + if ( zpThisLibProps.zpCollectionId + && jQuery(".zp-Browse-Collections-Select option.blank", zpThisLib).length == 0 ) + // && jQuery(".zp-Browse-Collections-Select option.toplevel", zpThisLib).length == 0 ) + if ( jQuery(".ZP_COLLECTION_NAME", zpThisLib).length > 0 ) + jQuery("select.zp-Browse-Collections-Select", zpThisLib) + .append( "\n" ); + // else + // jQuery("select.zp-Browse-Collections-Select", zpThisLib) + // .append( "\n" ); + + if ( zp_collections != "0" + && zp_collections.data.length > 0 + && zp_collections.data != "0" ) + { + jQuery.each(zp_collections.data, function( index, collection ) + { + var temp = "\n"; + + zp_collection_options += temp; + }); + + jQuery("select.zp-Browse-Collections-Select", zpThisLib).append( zp_collection_options ); + + // Then, continue with other requests, if they exist + if ( zp_collections.meta.request_next != false + && zp_collections.meta.request_next != "false" ) + zplib_get_collections ( l, zpThisLibProps, zpThisLib, zp_collections.meta.request_next, zp_collections.meta.request_last, update ); + else + if ( ! jQuery("select.zp-Browse-Collections-Select", zpThisLib).hasClass("updating") ) + zplib_get_collections ( l, zpThisLibProps, zpThisLib, 0, 0, true ); + } + + // Add "Back" if not Toplevel + // TODO: How to go up a level when in a subcollection? + if ( zpThisLibProps.zpCollectionId + && zpThisLibProps.zpCollectionId != "toplevel" + && jQuery(".zp-Browse-Collections-Select option.toplevel", zpThisLib).length == 0 ) + // jQuery("select.zp-Browse-Collections-Select", zpThisLib).append( "\n" ); + jQuery("select.zp-Browse-Collections-Select", zpThisLib).append( "\n" ); + + // Remove loading indicator + jQuery("select.zp-Browse-Collections-Select", zpThisLib).removeClass("loading").find(".loading").remove(); + }, + error: function(jqXHR) + { + console.log("Error for zplib_get_collections(): ", jqXHR.statusText); + }, + complete: function( jqXHRr, textStatus ) {} + }); + } + + + // Get list of tags + function zplib_get_tags ( i, zpThisLibProps, zpThisLib, request_start, request_last, update ) + { + // Set parameter defaults + if ( typeof(request_start) === "undefined" || request_start == "false" || request_start == "" ) + request_start = 0; + + if ( typeof(request_last) === "undefined" || request_last == "false" || request_last == "" ) + request_last = 0; + + jQuery.ajax( + { + url: zpShortcodeAJAX.ajaxurl, + ifModified: true, + data: { + 'action': 'zpRetrieveViaShortcode', + 'api_user_id': jQuery(".ZP_API_USER_ID", zpThisLib).text(), + 'item_type': 'tags', + 'is_dropdown': true, + 'maxtags': jQuery(".ZP_MAXTAGS", zpThisLib).text(), + 'request_start': request_start, + 'request_last': request_last, + 'update': update, + 'zpShortcode_nonce': zpShortcodeAJAX.zpShortcode_nonce + }, + xhrFields: { + withCredentials: true + }, + success: function(data) + { + var zp_tags = jQuery.parseJSON( data ); + + var zp_tag_options = "\n"; + if ( zpThisLibProps.zpTagId ) zp_tag_options = "\n"; + + + // Remove cached bib before adding updates + if ( update === false ) jQuery("select.zp-List-Tags", zpThisLib).addClass("used_cache"); + if ( update === true && ! jQuery("select.zp-List-Tags", zpThisLib).hasClass("updating") ) + jQuery("select.zp-List-Tags", zpThisLib).empty().addClass("updating"); + + if ( zp_tags !== 0 && zp_tags.data.length > 0 ) + { + jQuery.each( zp_tags.data, function( index, tag ) + { + var temp = "\n"; + + zp_tag_options += temp; + }); + jQuery("select.zp-List-Tags", zpThisLib).append( zp_tag_options ); + + // Then, continue with other requests, if they exist + if ( zp_tags.meta.request_next != false + && zp_tags.meta.request_next != "false" ) + zplib_get_tags ( i, zpThisLibProps, zpThisLib, zp_tags.meta.request_next, zp_tags.meta.request_last, update ); + else + if ( ! jQuery("select.zp-List-Tags", zpThisLib).hasClass("updating") ) + zplib_get_tags ( i, zpThisLibProps, zpThisLib, 0, 0, true ); + + // Remove loading indicator + jQuery("select.zp-List-Tags", zpThisLib).removeClass("loading").find(".loading").remove(); + } + else // Feedback + { + // Remove loading indicator + jQuery("select.zp-List-Tags", zpThisLib).removeClass("loading").find(".loading").remove(); + + jQuery("select.zp-List-Tags", zpThisLib).append( + "" + ); + } + }, + error: function(jqXHR) + { + console.log("Error for zplib_get_tags(): ", jqXHR.statusText); + }, + complete: function( jqXHRr, textStatus ) {} + }); + } + + + // Get list items + function zplib_get_items ( i, zpThisLibProps, zpThisLib, request_start, request_last, update ) + { + // Set parameter defaults + if ( typeof(request_start) === "undefined" || request_start == "false" || request_start == "" ) + request_start = 0; + + if ( typeof(request_last) === "undefined" || request_last == "false" || request_last == "" ) + request_last = 0; + + // Feedback on where in item chunking we're at + if ( jQuery(".zp-List", zpThisLib).hasClass("loading") + && jQuery(".zp-List", zpThisLib).find(".zp_display_progress").text() == "" ) + { + jQuery(".zp-List", zpThisLib).append( + ""+zpShortcodeAJAX.txt_nocitations+"
\n"); + } + }, + error: function(jqXHR) + { + console.log("Error for zplib_get_items(): ", jqXHR.statusText); + } + }); + } + +}); diff --git a/js/zotpress.lib.dropdown.min.js b/js/zotpress.lib.dropdown.min.js new file mode 100644 index 0000000..0ebca91 --- /dev/null +++ b/js/zotpress.lib.dropdown.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(){if(jQuery(".zp-Browse").length>0)for(let s=0;sNo items found.
\n"); + } + else // Display list of search results + { + jQuery.each(ui.content[3], function( index, item ) + { + var tempItem = " \n"); + + jQuery(".zpSearchResultsPagingContainer").show(); + }); + + + // Then, continue with other requests, if they exist + if ( ui.content[2].request_next != false + && ui.content[2].request_next != "false" ) + { + if ( zpItemsFlag == true ) + // window.zpACPagination(zpItemsFlag, false); + window.zpBrowseList[0].paginate(zpItemsFlag, false); + else + // window.zpACPagination(zpItemsFlag, true); + window.zpBrowseList[0].paginate(zpItemsFlag, true); + zpItemsFlag = false; + + zp_set_lib_searchbar_params( false, ui.content[2].request_next, ui.content[2].request_last ); + + jQuery("input.zp-Zotpress-SearchBox-Input").autocomplete( "option", "source", zpSearchBarSource+zpSearchBarParams ); + jQuery("input.zp-Zotpress-SearchBox-Input").autocomplete("search"); + } + else + { + // window.zpACPagination(zpItemsFlag, true); + window.zpBrowseList[0].paginate(zpItemsFlag, true); + zpItemsFlag = false; + } + } + }, + open: function () + { + // Don't show the dropdown + jQuery(".ui-autocomplete").hide(); + } + }); + + } // Zotpress SearchBar Library + +}); diff --git a/js/zotpress.lib.searchbar.min.js b/js/zotpress.lib.searchbar.min.js new file mode 100644 index 0000000..3e7f374 --- /dev/null +++ b/js/zotpress.lib.searchbar.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(){if(jQuery(".zp-Zotpress-SearchBox").length>0){var e=!0,t=1,r="",a="",n=zpShortcodeAJAX.ajaxurl+"?action=zpRetrieveViaShortcode&zpShortcode_nonce="+zpShortcodeAJAX.zpShortcode_nonce,u=!1;jQuery(".ZP_SHOWTAGS").length>0&&"1"==parseInt(jQuery(".ZP_SHOWTAGS").text())&&(u=!0);var o=!1;function s(e,t,r){void 0!==e&&"false"!=e&&""!=e||(e=!1),void 0!==t&&"false"!=t&&""!=t||(t=!1),void 0!==r&&"false"!=r&&""!=r||(r=!1),a="",a+="&api_user_id="+jQuery(".ZOTPRESS_USER").val(),a+="&item_type=items",a+="&downloadable="+jQuery(".ZOTPRESS_AC_DOWNLOAD").val(),a+="&style="+jQuery(".ZP_STYLE").text(),a+="&sortby="+jQuery(".ZP_SORTBY").text(),a+="&order="+jQuery(".ZP_ORDER").text(),a+="&citeable="+jQuery(".ZOTPRESS_AC_CITE").val(),jQuery(".ZOTPRESS_AC_MAXRESULTS").val().length>0&&(a+="&maxresults="+jQuery(".ZOTPRESS_AC_MAXRESULTS").val()),u&&(a+="&showtags=true"),o&&(a+="&showimage=true"),t&&(a+="&request_start="+t),r&&(a+="&request_last="+r),a+="&update=true",e?a+="&filter="+e:jQuery("input[name=zpSearchFilters]").length>0&&(a+="&filter="+jQuery("input[name=zpSearchFilters]:checked").val())}jQuery(".ZOTPRESS_AC_IMAGES").length>0&&(o=!0),s(!1,!1,!1),jQuery("input[name='zpSearchFilters']").click(function(){jQuery("input[name=zpSearchFilters]").length>0&&s(jQuery(this).val(),!1,!1),jQuery("input.zp-Zotpress-SearchBox-Input").autocomplete("option","source",n+a),jQuery("input.zp-Zotpress-SearchBox-Input").val().length>0&&jQuery("input.zp-Zotpress-SearchBox-Input").val()!=zpShortcodeAJAX.txt_typetosearch&&jQuery("input.zp-Zotpress-SearchBox-Input").autocomplete("search")}),jQuery("input.zp-Zotpress-SearchBox-Input").bind("keydown",function(e){e.keyCode===jQuery.ui.keyCode.TAB&&jQuery(this).data("autocomplete").menu.active&&e.preventDefault(),13===e.keyCode&&e.preventDefault()}).bind("focus",function(e){jQuery(this).val()==zpShortcodeAJAX.txt_typetosearch&&(jQuery(this).val(""),jQuery(this).removeClass("help"))}).bind("blur",function(e){""==jQuery.trim(jQuery(this).val())&&(jQuery(this).val(zpShortcodeAJAX.txt_typetosearch),jQuery(this).addClass("help"))}).autocomplete({source:n+a,minLength:jQuery(".ZOTPRESS_AC_MINLENGTH").val(),focus:function(){return!1},search:function(u,o){var p=!1;u.hasOwnProperty("currentTarget")&&(p=u.currentTarget.value),t=1,(1==e||p&&p!=r)&&(jQuery(".zp-List .zpSearchLoading").addClass("show"),jQuery(".zpSearchResultsPaging").length>0&&(jQuery(".zpSearchResultsPaging").empty(),jQuery(".zpSearchResultsPagingContainer").hide()),jQuery(".zpSearchResultsContainer").empty(),s(!1,0,!1),jQuery("input.zp-Zotpress-SearchBox-Input").autocomplete("option","source",n+a),window.zpPage=1,1==e&&p&&(r=p))},response:function(r,p){jQuery(".zp-List .zpSearchLoading").removeClass("show"),"0"==p.content||"empty"==p.content[0].label?(jQuery(".zpSearchResultsPaging").length>0&&(jQuery(".zpSearchResultsPaging").empty(),jQuery(".zpSearchResultsPagingContainer").hide()),jQuery(".zpSearchResultsContainer").append("No items found.
\n")):(jQuery.each(p.content[3],function(e,r){var a=" \x3c!-- .zp-Entry --\x3e\n"),jQuery(".zpSearchResultsPagingContainer").show()}),0!=p.content[2].request_next&&"false"!=p.content[2].request_next?(1==e?window.zpBrowseList[0].paginate(e,!1):window.zpBrowseList[0].paginate(e,!0),e=!1,s(!1,p.content[2].request_next,p.content[2].request_last),jQuery("input.zp-Zotpress-SearchBox-Input").autocomplete("option","source",n+a),jQuery("input.zp-Zotpress-SearchBox-Input").autocomplete("search")):(window.zpBrowseList[0].paginate(e,!0),e=!1))},open:function(){jQuery(".ui-autocomplete").hide()}})}}); diff --git a/js/zotpress.shortcode.bib.js b/js/zotpress.shortcode.bib.js new file mode 100644 index 0000000..8a03a84 --- /dev/null +++ b/js/zotpress.shortcode.bib.js @@ -0,0 +1,668 @@ +jQuery(document).ready(function() +{ + /////////////////////////////// + // // + // ZOTPRESS BIBLIOGRAPHY // + // // + /////////////////////////////// + + if ( jQuery(".zp-Zotpress-Bib").length > 0 ) + { + var zp_collections = {}; + var zp_totalItems = 0; + + jQuery(".zp-Zotpress-Bib").each( function( index, instance ) + { + var $instance = jQuery(instance); + var zp_params = {}; + + zp_params.zpItemkey = false; if ( jQuery(".ZP_ITEM_KEY", $instance).text().trim().length > 0 ) zp_params.zpItemkey = jQuery(".ZP_ITEM_KEY", $instance).text(); + zp_params.zpItemType = false; if ( jQuery(".ZP_ITEMTYPE", $instance).text().trim().length > 0 ) zp_params.zpItemType = jQuery(".ZP_ITEMTYPE", $instance).text(); + zp_params.zpCollectionId = false; if ( jQuery(".ZP_COLLECTION_ID", $instance).text().trim().length > 0 ) zp_params.zpCollectionId = jQuery(".ZP_COLLECTION_ID", $instance).text(); + zp_params.zpTagId = false; if ( jQuery(".ZP_TAG_ID", $instance).text().trim().length > 0 ) zp_params.zpTagId = jQuery(".ZP_TAG_ID", $instance).text(); + zp_params.zpAuthor = false; if ( jQuery(".ZP_AUTHOR", $instance).text().trim().length > 0 ) zp_params.zpAuthor = jQuery(".ZP_AUTHOR", $instance).text(); + zp_params.zpYear = false; if ( jQuery(".ZP_YEAR", $instance).text().trim().length > 0 ) zp_params.zpYear = jQuery(".ZP_YEAR", $instance).text(); + zp_params.zpStyle = false; if ( jQuery(".ZP_STYLE", $instance).text().trim().length > 0 ) zp_params.zpStyle = jQuery(".ZP_STYLE", $instance).text(); + zp_params.zpLimit = false; if ( jQuery(".ZP_LIMIT", $instance).text().trim().length > 0 ) zp_params.zpLimit = jQuery(".ZP_LIMIT", $instance).text(); + zp_params.zpTitle = false; if ( jQuery(".ZP_TITLE", $instance).text().trim().length > 0 ) zp_params.zpTitle = jQuery(".ZP_TITLE", $instance).text(); + + zp_params.zpShowImages = false; if ( jQuery(".ZP_SHOWIMAGE", $instance).text().trim().length > 0 ) zp_params.zpShowImages = jQuery(".ZP_SHOWIMAGE", $instance).text().trim(); + zp_params.zpShowTags = false; if ( jQuery(".ZP_SHOWTAGS", $instance).text().trim().length > 0 ) zp_params.zpShowTags = true; + zp_params.zpDownloadable = false; if ( jQuery(".ZP_DOWNLOADABLE", $instance).text().trim().length > 0 ) zp_params.zpDownloadable = true; + zp_params.zpInclusive = false; if ( jQuery(".ZP_INCLUSIVE", $instance).text().trim().length > 0 ) zp_params.zpInclusive = true; + zp_params.zpShowNotes = false; if ( jQuery(".ZP_NOTES", $instance).text().trim().length > 0 ) zp_params.zpShowNotes = true; + zp_params.zpShowAbstracts = false; if ( jQuery(".ZP_ABSTRACT", $instance).text().trim().length > 0 ) zp_params.zpShowAbstracts = true; + zp_params.zpCiteable = false; if ( jQuery(".ZP_CITEABLE", $instance).text().trim().length > 0 ) zp_params.zpCiteable = true; + zp_params.zpTarget = false; if ( jQuery(".ZP_TARGET", $instance).text().trim().length > 0 ) zp_params.zpTarget = true; + zp_params.zpURLWrap = false; if ( jQuery(".ZP_URLWRAP", $instance).text().trim().length > 0 ) zp_params.zpURLWrap = jQuery(".ZP_URLWRAP", $instance).text(); + zp_params.zpHighlight = false; if ( jQuery(".ZP_HIGHLIGHT", $instance).text().trim().length > 0 ) zp_params.zpHighlight = jQuery(".ZP_HIGHLIGHT", $instance).text(); + + zp_params.zpForceNumsCount = 1; + zp_params.zpBibIndex = index; + + // Deal with multiples + // Order of priority: collections, tags, authors, years + // Filters (dealt with on shortcode.request.php): tags?, authors, years + if ( zp_params.zpCollectionId + && zp_params.zpCollectionId.indexOf(',') != -1 ) + { + zp_collections[index] = zp_params.zpCollectionId.split(','); + + // Set the initial collection + // var currentCollection = zp_collections[0]; + zp_params.zpCollectionId = zp_collections[index][0]; + + zp_get_items ( 0, 0, $instance, zp_params, false ); + + // jQuery.each( zp_collections, function (i, collection) + // { + // zp_params.zpCollectionId = collection; + // zp_get_items ( 0, 0, $instance, zp_params, false ); // Get cached items first + // }); + } + else + { + // Inclusive tags (treat exclusive normally) + if ( zp_params.zpTagId && zp_params.zpInclusive == true && zp_params.zpTagId.indexOf(",") != -1 ) + { + var tempTags = zp_params.zpTagId.split(","); + + jQuery.each( tempTags, function (i, tag) + { + zp_params.zpTagId = tag; + zp_get_items ( 0, 0, $instance, zp_params, false ); // Get cached items first + }); + } + else + { + if ( zp_params.zpAuthor && zp_params.zpAuthor.indexOf(",") != -1 ) + { + var tempAuthors = zp_params.zpAuthor.split(","); + + if ( zp_params.zpInclusive == true ) + { + jQuery.each( tempAuthors, function (i, author) + { + zp_params.zpAuthor = author; + zp_get_items ( 0, 0, $instance, zp_params, false ); + }); + } + else // exclusive + { + zp_get_items ( 0, 0, $instance, zp_params, false ); + } + } + else + { + if ( zp_params.zpYear && zp_params.zpYear.indexOf(",") != -1 ) + { + var tempYears = zp_params.zpYear.split(","); + + jQuery.each( tempYears, function (i, year) + { + zp_params.zpYear = year; + zp_get_items ( 0, 0, $instance, zp_params, false ); + }); + } + else // NORMAL, no multiples + { + zp_get_items ( 0, 0, $instance, zp_params, false ); + } + } + } + } + // zp_params = JSON.stringify(zp_params); + }); + } // Zotpress Bibliography + + + + // Get list items: + function zp_get_items ( request_start, request_last, $instance, params, update ) + { + if ( typeof(request_start) === "undefined" || request_start == "false" || request_start == "" ) + request_start = 0; + + if ( typeof(request_last) === "undefined" || request_last == "false" || request_last == "" ) + request_last = 0; + + + jQuery.ajax( + { + url: zpShortcodeAJAX.ajaxurl, + ifModified: true, + data: { + 'action': 'zpRetrieveViaShortcode', + 'instance_id': $instance.attr("id"), + 'api_user_id': jQuery(".ZP_API_USER_ID", $instance).text(), + 'item_type': jQuery(".ZP_ITEM_TYPE", $instance).text(), + + 'item_key': params.zpItemkey, + 'itemtype': params.zpItemType, + 'collection_id': params.zpCollectionId, + 'tag_id': params.zpTagId, + + 'author': encodeURI(params.zpAuthor).replace("'","%27"), + 'year': params.zpYear, + 'style': params.zpStyle, + 'limit': params.zpLimit, + 'title': params.zpTitle, + + 'showimage': params.zpShowImages, + 'showtags': params.zpShowTags, + 'downloadable': params.zpDownloadable, + 'inclusive': params.zpInclusive, + 'shownotes': params.zpShowNotes, + 'showabstracts': params.zpShowAbstracts, + 'citeable': params.zpCiteable, + + 'target': params.zpTarget, + 'urlwrap': params.zpURLWrap, + 'highlight': params.zpHighlight, + + 'sortby': jQuery(".ZP_SORTBY", $instance).text(), + 'order': jQuery(".ZP_ORDER", $instance).text(), + + 'update': update, + 'request_start': request_start, + 'request_last': request_last, + 'zpShortcode_nonce': zpShortcodeAJAX.zpShortcode_nonce + }, + xhrFields: { + withCredentials: true + }, + success: function(data) + { + var zp_items = jQuery.parseJSON( data ); + + if ( ! update ) zp_totalItems += zp_items.data.length; + if ( update ) console.log("zp: checking for updates ..."); + if ( update ) console.log("zp: updating items",zp_items.data.length); + else console.log("zp: adding items",zp_items.data.length); + console.log("zp: total items so far",zp_totalItems); + + // Account for Zotero errors + // QUESTION: Did something change? Now have to ref [0] + if ( zp_items.status == 'empty' + || zp_items.data == 'Not found' ) + { + var zp_msg = zpShortcodeAJAX.txt_zperror + " "; + + if ( zp_items.data == 0 ) + { + zp_items.data = zpShortcodeAJAX.txt_noitemsfound; + zp_msg = zp_items.data; + } + else { + zp_msg += zp_items.data; + } + + console.log( "Zotpress: " + zp_msg ); + + // Hide errors if something shown + var hideErrMsg = ''; + if ( jQuery( "#"+zp_items.instance+" .zp-List .zp-Entry" ).length > 0 ) + hideErrMsg = ' class="hide"'; + + // Remove the loader, display the message + jQuery( "#"+zp_items.instance+" .zp-List" ) + .removeClass( 'loading' ) + .append( ''+zp_msg+'
' ); + } + + // Success! Process as items + else + { + // First, remove any PHP SEO items that exist + jQuery("#"+zp_items.instance+" .zp-SEO-Content").remove(); + + // // QUESTION: Then prepare the data as a JSON? + // zp_items.data = jQuery.parseJSON(zp_items.data); + + // First, display the items from this request, if any: + if ( typeof zp_items != 'undefined' + && zp_items != null + && zp_items != 0 + && zp_items.data.length > 0 ) + { + var tempItems = ""; + if ( params.zpShowNotes == true ) + var tempNotes = ""; + + + // Indicate whether cache has been used: + if ( update === false ) + { + jQuery("#"+zp_items.instance+" .zp-List").addClass("used_cache"); + } + else if ( update === true ) + { + // Remove existing notes temporarily: + if ( ! jQuery("#"+zp_items.instance+" .zp-List").hasClass("updating") + && jQuery("#"+zp_items.instance+" .zp-Citation-Notes").length > 0 ) + jQuery("#"+zp_items.instance+" .zp-Citation-Notes").remove(); + + if ( ! jQuery("#"+zp_items.instance+" .zp-List").hasClass("updating") ) + jQuery("#"+zp_items.instance+" .zp-List").addClass("updating"); + + params.zpForceNumsCount = 1; + } + + + // CHANGED (7.3): Make sure that there are items ... + if ( zp_items.data != 0 ) + { + jQuery.each( zp_items.data, function( index, item ) + { + var tempItem = ""; + + // Determine item reference + var $item_ref = jQuery("#"+zp_items.instance+" .zp-List #zp-ID-"+jQuery(".ZP_POSTID", $instance).text()+"-"+jQuery(".ZP_API_USER_ID", $instance).text()+"-"+item.key); + + // Replace or skip duplicates + if ( $item_ref.length > 0 + && update === false + && ! jQuery("#"+zp_items.instance+" .zp-List").hasClass("used_cache") ) + return false; + + // Item Type + var tempItemType = "none"; + if ( item.data.hasOwnProperty('itemType') ) + tempItemType = item.data.itemType; + + // Year and Date + var tempItemYear = "0000"; // yyyy + var tempItemDate = "0000"; // yyyy-mm-dd + if ( item.meta.hasOwnProperty('parsedDate') ) + { + tempItemYear = item.meta.parsedDate.substring(0, 4); + tempItemDate = item.meta.parsedDate; + } + + // Author + var tempAuthor = item.data.title; + if ( item.meta.hasOwnProperty('creatorSummary') ) + tempAuthor = item.meta.creatorSummary.replace( / /g, "-" ); + + tempItem += "Abstract: " +item.data.abstractNote+ "
\n"; + + // Add tags, if any + if ( params.zpShowTags == true && + ( item.data.hasOwnProperty('tags') && item.data.tags.length > 0 ) ) + { + tempItem += "Tags: "; + + jQuery.each(item.data.tags, function ( tindex, tag ) + { + tempItem += "" + tag.tag + ""; + if ( tindex != (item.data.tags.length-1) ) tempItem += ", "; + }); + tempItem += "
\n"; + } + + tempItem += "There are no citations to display.
\n"); + } + } + } + }, + error: function(errorThrown) + { + console.log("Zotpress via WP AJAX Error: ", errorThrown); + } + }); + + } // function zp_get_items + + + function zp_bib_reformat( $instance, zp_items, zp_params ) + { + var sortby = jQuery(".ZP_SORTBY", $instance).text(); + var orderby = jQuery(".ZP_ORDER", $instance).text(); + + var sortOrder = "data-zp-author-date"; + if ( sortby == "date") + sortOrder = "data-zp-date-author"; + + // First, sort items the typical way + typicalSort( zp_items, sortby, sortOrder, orderby ); + + // Deal with the Title situation + if ( zp_params.zpTitle !== false ) + { + // First, make an object of title sort types; + // each will contain an arr of entry IDs in this format: + // { titleSortType: [ entryID ] } + // e.g., { '2017': [ 'zp-ID--237927-PZ2HQ9V7', 'zp-ID--237927-HSHEURFV' ] } + // e.g., { 'book': [ 'zp-ID--237927-PZ2HQ9V7', 'zp-ID--237927-HSHEURFV' ] } + var titleSortedEntries = {}; + + // Then, get the Title sort type per item + jQuery("#"+zp_items.instance+" .zp-List div.zp-Entry").each( + function(i, entry) + { + // Then the title sort types, e.g., particular years + var titleSortType = jQuery(entry).data( 'zp-'+zp_params.zpTitle ); + + // Add title sort type to arr, if not there + if ( titleSortedEntries.hasOwnProperty(titleSortType) === false ) + titleSortedEntries[titleSortType] = []; + + // Add entry ID and data sort to the right title sort type + titleSortedEntries[titleSortType].push( + // { [jQuery(entry).attr('id')] : titleSortType } + jQuery(entry).attr('id') + ); + } + ); + + // Then, sort the title sort, depending on its type + var titleSortedEntriesOrder = Object.getOwnPropertyNames(titleSortedEntries); + + if ( zp_params.zpTitle == "itemtype" ) + { + // First, make an array with the desired order of known types + // NOTE: Based on https://www.zotero.org/support/kb/item_types_and_fields + var orderedTypes = [ + 'book', + 'bookSection', + 'journalArticle', + 'conferencePaper', + 'thesis', + 'report', + 'encyclopediaArticle', + 'newspaperArticle', + 'magazineArticle', + 'presentation', + 'interview', + 'dictionaryEntry', + 'document', + 'manuscript', + 'patent', + 'map', + 'blogPost', + 'webpage', + 'artwork', + 'film', + 'audioRecording', + 'statute', + 'bill', + 'case', + 'hearing', + 'forumPost', + 'letter', + 'email', + 'instantMessage', + 'software', + 'podcast', + 'radioBroadcast', + 'tvBroadcast', + 'videoRecording', + 'attachment', + 'note' + ]; + + // Then, remove any that aren't in the existing array + orderedTypes.slice(0).forEach( function(orderedType, i) + { + if ( titleSortedEntriesOrder.indexOf(orderedType) == -1 ) + orderedTypes.splice( orderedTypes.indexOf(orderedType), 1 ); + }); + + titleSortedEntriesOrder = orderedTypes; + } + else // Assume year + { + if ( orderby == "asc" ) + titleSortedEntriesOrder.sort( function(a, b) { return a-b; } ); + else + titleSortedEntriesOrder.sort( function(a, b) { return b-a; } ); + } + + // Next, restructure bib based on this order + titleSortedEntriesOrder.forEach( function(orderedType, i) + { + // First, make a nice name for the type + var tempTitle = orderedType; + + // Deal with `itemtype` formatting + if ( zp_params.zpTitle == "itemtype" ) + { + if ( tempTitle.match(/[A-Z]/) !== null ) + { + var tempPos = tempTitle.match(/[A-Z]/).index; + tempTitle = tempTitle.substr(0, tempPos)+' '+tempTitle.substr(tempPos); + } + tempTitle = tempTitle.charAt(0).toUpperCase() + tempTitle.slice(1); + } + + // Deal with no date, if applicable + if ( tempTitle == "0000" ) + tempTitle = "No date"; + + // Then, add the header, if it doesn't exist + // REVIEW: This only considers date/year, after initial sort, + // and if header not already there + if ( zp_params.zpTitle == "year" ) + { + // Just add the header, initially or if it doesn't exist + if ( jQuery("#"+$instance.attr("id")+" .zp-List h3[rel='"+orderedType+"']").length == 0 ) + jQuery("#"+$instance.attr("id")+" .zp-List").append( ""+l+"
")}else if(jQuery("#"+s.instance+" .zp-SEO-Content").remove(),void 0!==s&&null!=s&&0!=s&&s.data.length>0){var c="";if(!0==r.zpShowNotes)var d="";!1===o?jQuery("#"+s.instance+" .zp-List").addClass("used_cache"):!0===o&&(!jQuery("#"+s.instance+" .zp-List").hasClass("updating")&&jQuery("#"+s.instance+" .zp-Citation-Notes").length>0&&jQuery("#"+s.instance+" .zp-Citation-Notes").remove(),jQuery("#"+s.instance+" .zp-List").hasClass("updating")||jQuery("#"+s.instance+" .zp-List").addClass("updating"),r.zpForceNumsCount=1),0!=s.data&&jQuery.each(s.data,function(t,e){var a="",i=jQuery("#"+s.instance+" .zp-List #zp-ID-"+jQuery(".ZP_POSTID",p).text()+"-"+jQuery(".ZP_API_USER_ID",p).text()+"-"+e.key);if(i.length>0&&!1===o&&!jQuery("#"+s.instance+" .zp-List").hasClass("used_cache"))return!1;var n="none";e.data.hasOwnProperty("itemType")&&(n=e.data.itemType);var l="0000",z="0000";e.meta.hasOwnProperty("parsedDate")&&(l=e.meta.parsedDate.substring(0,4),z=e.meta.parsedDate);var h=e.data.title;e.meta.hasOwnProperty("creatorSummary")&&(h=e.meta.creatorSummary.replace(/ /g,"-")),a+="Abstract: "+e.data.abstractNote+"
\n"),!0==r.zpShowTags&&e.data.hasOwnProperty("tags")&&e.data.tags.length>0&&(a+="Tags: ",jQuery.each(e.data.tags,function(t,i){a+=""+i.tag+"",t!=e.data.tags.length-1&&(a+=", ")}),a+="
\n"),a+="There are no citations to display.
\n"))},error:function(t){console.log("Zotpress via WP AJAX Error: ",t)}})}function i(t,e,a){var i,n,s,p,r=jQuery(".ZP_SORTBY",t).text(),o=jQuery(".ZP_ORDER",t).text(),l="data-zp-author-date";if("date"==r&&(l="data-zp-date-author"),i=e,n=r,s=l,p=o,-1!==["author","date"].indexOf(n)&&0==jQuery("#"+i.instance+" .zp-List .csl-left-margin").length&&jQuery("#"+i.instance+" .zp-List div.zp-Entry").sort(function(t,e){var a=t.getAttribute(s).toLowerCase(),i=e.getAttribute(s).toLowerCase();if(a>i)return"asc"==p?1:-1;return a"+n+"\n"),"year"==a.zpTitle&&"asc"==o?z[e].reverse():"itemtype"==a.zpTitle&&"date"==r&&z[e].reverse(),z[e].forEach(function(a,i){jQuery("#"+t.attr("id")+" #"+a).insertAfter(jQuery("#"+t.attr("id")+" .zp-List h3[rel='"+e+"']"))})})}}}); \ No newline at end of file diff --git a/js/zotpress.shortcode.intext.js b/js/zotpress.shortcode.intext.js new file mode 100644 index 0000000..bb85bb8 --- /dev/null +++ b/js/zotpress.shortcode.intext.js @@ -0,0 +1,931 @@ +jQuery(document).ready(function() +{ + ////////////////////////// + // // + // ZOTPRESS IN-TEXT // + // // + ////////////////////////// + + if ( jQuery(".zp-Zotpress-InTextBib").length > 0 ) + { + // Create global array for citations per post + window.zpIntextCitations = {}; + window.zpIntextCitationCount = {}; + + jQuery(".zp-Zotpress-InTextBib").each( function( index, instance ) + { + var $instance = jQuery(instance); + var zp_params = {}; + window.zpIntextCitations["post-"+jQuery(".ZP_POSTID", $instance).text()] = {}; + + zp_params.zpItemkey = false; if ( jQuery(".ZP_ITEM_KEY", $instance).text().trim().length > 0 ) zp_params.zpItemkey = jQuery(".ZP_ITEM_KEY", $instance).text(); + + zp_params.zpStyle = false; if ( jQuery(".ZP_STYLE", $instance).text().trim().length > 0 ) zp_params.zpStyle = jQuery(".ZP_STYLE", $instance).text(); + zp_params.zpTitle = false; if ( jQuery(".ZP_TITLE", $instance).text().trim().length > 0 ) zp_params. zpTitle = jQuery(".ZP_TITLE", $instance).text(); + + zp_params.zpShowImages = false; if ( jQuery(".ZP_SHOWIMAGE", $instance).text().trim().length > 0 ) zp_params.zpShowImages = jQuery(".ZP_SHOWIMAGE", $instance).text().trim(); + zp_params.zpShowTags = false; if ( jQuery(".ZP_SHOWTAGS", $instance).text().trim().length > 0 ) zp_params.zpShowTags = true; + zp_params.zpDownloadable = false; if ( jQuery(".ZP_DOWNLOADABLE", $instance).text().trim().length > 0 ) zp_params.zpDownloadable = true; + zp_params.zpShowNotes = false; if ( jQuery(".ZP_NOTES", $instance).text().trim().length > 0 ) zp_params.zpShowNotes = true; + zp_params.zpShowAbstracts = false; if ( jQuery(".ZP_ABSTRACT", $instance).text().trim().length > 0 ) zp_params.zpShowAbstracts = true; + zp_params.zpCiteable = false; if ( jQuery(".ZP_CITEABLE", $instance).text().trim().length > 0 ) zp_params.zpCiteable = true; + zp_params.zpTarget = false; if ( jQuery(".ZP_TARGET", $instance).text().trim().length > 0 ) zp_params.zpTarget = true; + zp_params.zpURLWrap = false; if ( jQuery(".ZP_URLWRAP", $instance).text().trim().length > 0 ) zp_params.zpURLWrap = jQuery(".ZP_URLWRAP", $instance).text(); + zp_params.zpHighlight = false; if ( jQuery(".ZP_HIGHLIGHT", $instance).text().trim().length > 0 ) zp_params.zpHighlight = jQuery(".ZP_HIGHLIGHT", $instance).text(); + + zp_params.zpSortBy = false; if ( jQuery(".ZP_SORTBY", $instance).text().trim().length > 0 ) zp_params.zpSortBy = jQuery(".ZP_SORTBY", $instance).text(); + zp_params.zpOrder = false; if ( jQuery(".ZP_ORDER", $instance).text().trim().length > 0 ) zp_params.zpOrder = jQuery(".ZP_ORDER", $instance).text(); + + zp_get_items ( 0, 0, $instance, zp_params, false ); // Get cached items first + }); + + } // Zotpress In-Text + + // Get list items + function zp_get_items ( request_start, request_last, $instance, params, update ) + { + if ( typeof(request_start) === "undefined" || request_start == "false" || request_start == "" ) + request_start = 0; + + if ( typeof(request_last) === "undefined" || request_last == "false" || request_last == "" ) + request_last = 0; + + jQuery.ajax( + { + url: zpShortcodeAJAX.ajaxurl, + ifModified: true, + data: { + 'action': 'zpRetrieveViaShortcode', + 'instance_id': $instance.attr("id"), + // 'api_user_id': jQuery(".ZP_API_USER_ID", $instance).text(), + 'type': "intext", + + 'item_key': params.zpItemkey, + + 'style': params.zpStyle, + 'title': params.zpTitle, + + 'showimage': params.zpShowImages, + 'showtags': params.zpShowTags, + 'downloadable': params.zpDownloadable, + 'shownotes': params.zpShowNotes, + 'showabstracts': params.zpShowAbstracts, + 'citeable': params.zpCiteable, + + 'target': params.zpTarget, + 'urlwrap': params.zpURLWrap, + 'highlight': params.zpHighlight, + + 'sortby': params.zpSortBy, + 'order': params.zpOrder, + + // 'sortby': jQuery(".ZP_SORTBY", $instance).text(), + // 'order': jQuery(".ZP_ORDER", $instance).text(), + + 'update': update, + 'request_start': request_start, + 'request_last': request_last, + 'zpShortcode_nonce': zpShortcodeAJAX.zpShortcode_nonce + }, + xhrFields: { + withCredentials: true + }, + success: function(data) + { + var zp_items = jQuery.parseJSON( data ); + + // Account for Zotero errors + if ( zp_items.status == 'error' ) + { + console.log( 'Zotpress Error: ' + zp_items.data ); + + // Hide errors if something shown + var hideErrMsg = ''; + if ( jQuery( "#"+zp_items.instance+" .zp-List .zp-Entry" ).length > 0 ) + hideErrMsg = ' class="hide"'; + + // Remove the loader + jQuery( "#"+zp_items.instance+" .zp-List" ) + .removeClass( 'loading' ) + .append( 'Zotpress Error: '+zp_items.data+'
' ); + } + + // Process as items + else + { + // First, display the items from this request, if any + if ( typeof zp_items != 'undefined' + && zp_items != null && parseInt(zp_items) != 0 + && zp_items.data.length > 0 ) + { + // var tempItems = ""; + if ( params.zpShowNotes == true ) var tempNotes = ""; + if ( params.zpTitle == true ) var tempTitle = ""; + var $postRef = jQuery($instance).parent(); + + + // Indicate whether cache has been used + if ( update === false ) + { + jQuery("#"+zp_items.instance+" .zp-List").addClass("used_cache"); + } + else if ( update === true ) + { + // Remove existing notes temporarily + if ( ! jQuery("#"+zp_items.instance+" .zp-List").hasClass("updating") + && jQuery("#"+zp_items.instance+" .zp-Citation-Notes").length > 0 ) + jQuery("#"+zp_items.instance+" .zp-Citation-Notes").remove(); + + if ( ! jQuery("#"+zp_items.instance+" .zp-List").hasClass("updating") ) + jQuery("#"+zp_items.instance+" .zp-List").addClass("updating"); + } + + + // Format in-text citations + zp_format_intext_citations( $instance, params.zpItemkey, zp_items.data, params, update ); + + // Format in-text bibliography + // tempItems = zp_format_intextbib ( $instance, zp_items, params.zpItemkey, params, update ); + zp_format_intextbib ( $instance, zp_items, params.zpItemkey, params, update ); + + // Add cached OR initial request items (first 50) to list + if ( update === false ) + // && tempItems.length > 0 ) + { + // First, remove any PHP SEO container + // jQuery("#"+zp_items.instance+" .zp-SEO-Content").remove(); + jQuery("#"+zp_items.instance+" .zp-SEO-Content .zp-Entry").unwrap(); + + // Then add the items + // jQuery("#"+zp_items.instance+" .zp-List").append( tempItems ); + } + + // Append notes to container + if ( params.zpShowNotes == true && tempNotes.length > 0 ) + { + tempNotes = "There are no citations to display.
\n"); + } + } + }, + error: function(errorThrown) + { + console.log( 'Zotpress Error:' + errorThrown ); + } + }); + + } // function zp_get_items + + function zp_format_intext_citations ( $instance, item_keys, item_data, params, update ) + { + // Tested formats: + // KEY + // {KEY} + // {KEY,3-9} + // KEY,{KEY,8} + + var intext_citations = []; + + // Create array for multiple in-text citations -- semicolon + if ( item_keys.indexOf(";") != -1 ) intext_citations = item_keys.split( ";" ); + else intext_citations.push( item_keys ); + + + // Re-structure item_data + var tempItem_data = {}; + jQuery.each( item_data, function (index, value ) + { + if ( ! tempItem_data.hasOwnProperty(value.key) ) + tempItem_data[value.key] = value; + }); + item_data = tempItem_data; + + + // REVIEW: Account for repeat citations + var intextGroupTracker = {}; + + jQuery.each( intext_citations, function (index, intext_citation) + { + var intext_citation_output = ""; + var $postRef = jQuery($instance).parent(); + + // REVIEW: Is this the right reformatting for the ID? + // var tempId = intext_citation.replace( /{/g, "-" ).replace( /}/g, "-" ).replace( /,/g, "_" ).replace( /\//g, "_" ).replace( /\+/g, "_" ).replace( /&/g, "_" ).replace( / /g, "_" ).replace( /:/g, "--" ); + var tempId = intext_citation.replace( /{/g, "-" ).replace( /}/g, "-" ).replace( /,/g, "_" ).replace( /:/g, "-" ); + // REVIEW: No longer counting by post + // var intext_citation_id = "zp-InText-zp-ID-"+jQuery(".ZP_API_USER_ID", $instance).text()+"-"+tempId+"-"+jQuery(".ZP_POSTID", $instance).text()+"-"+(index+1); + var intext_citation_id = "zp-InText-zp-ID-"+tempId+"-wp"+jQuery(".ZP_POSTID", $instance).text(); + + // REVIEW: Account for repeat citation groups + var intext_group_index = 0; + + // Make a tracker for multiples, if one doesn't exist + if ( jQuery("."+intext_citation_id, $postRef ).length > 1 ) + if ( ! intextGroupTracker.hasOwnProperty(intext_citation_id) ) + intextGroupTracker[intext_citation_id] = 0; + else // Set index + intext_group_index = intextGroupTracker[intext_citation_id]; + + var intext_citation_params = JSON.parse( jQuery("."+intext_citation_id+":eq("+intext_group_index+")", $postRef ).attr("rel").replace( /'/g, '"') ); + + // REVIEW: New way based on new format + // Expects: {api:key}, with pages in intext_citation_params + + // Divide up multiple items (if exist): always produc an array + intext_citation_split = intext_citation.split( "},{" ); + + // Prepare it as an array + intext_citation = new Array(); + + jQuery.each ( intext_citation_split, function ( id, item ) + { + item_parts = item.split( ":" ); + + // Deal with pages + item_pages = false; + if ( intext_citation_params.pages != "np" ) + { + item_pages = intext_citation_params.pages.split( "--" ); + + if ( item_pages[id] == "np" ) + item_pages[id] = false; + + item_pages = item_pages[id]; + } + + intext_citation[id] = + { + "api_user_id": item_parts[0].replace( "{", "" ), + "key": item_parts[1].replace( "}", "" ), + "post_id": jQuery(".ZP_POSTID", $instance).text(), + "pages": item_pages, + // "bib": "", + // "citation_ids": "" + }; + }); + + + // // Create array from item keys + // if ( intext_citation.indexOf("{") != -1 ) // bracket + // { + // if ( intext_citation.indexOf("},") != -1 ) // multiple items + // { + // intext_citation = intext_citation.split( "}," ); + // + // // Get rid of brackets, format pages + // jQuery.each ( intext_citation, function ( id, item ) + // { + // // Check for pages + // if ( item.indexOf( "," ) != -1 ) + // { + // item = item.split( "," ); + // intext_citation[id] = { "key": item[0].replace( "}", "" ).replace( "{", "" ), "api_user_id": jQuery(".ZP_API_USER_ID", $instance).text(), "post_id": jQuery(".ZP_POSTID", $instance).text(), "pages": item[1].replace( "}", "" ), "bib": "", "citation_ids": "" }; + // } + // else // No pages + // { + // intext_citation[id] = { "key": item.replace( "}", "" ).replace( "{", "" ), "api_user_id": jQuery(".ZP_API_USER_ID", $instance).text(), "post_id": jQuery(".ZP_POSTID", $instance).text(), "pages": false, "bib": "", "citation_ids": "" }; + // } + // }); + // } + // else // single bracket + // { + // if ( intext_citation.indexOf( "," ) != -1 ) // Pages + // { + // var item = intext_citation.split( "," ); + // intext_citation = [{ "key": item[0].replace( "}", "" ).replace( "{", "" ), "api_user_id": jQuery(".ZP_API_USER_ID", $instance).text(), "post_id": jQuery(".ZP_POSTID", $instance).text(), "pages": item[1].replace( "}", "" ), "bib": "", "citation_ids": "" }]; + // } + // else // no pages + // { + // intext_citation = [{ "key": intext_citation.replace( "}", "" ).replace( "{", "" ), "api_user_id": jQuery(".ZP_API_USER_ID", $instance).text(), "post_id": jQuery(".ZP_POSTID", $instance).text(), "pages": false, "bib": "", "citation_ids": "" }]; + // } + // } + // } + // else // no bracket, no pages + // { + // intext_citation = [{ "key": intext_citation, "api_user_id": jQuery(".ZP_API_USER_ID", $instance).text(), "post_id": jQuery(".ZP_POSTID", $instance).text(), "pages": false, "bib": "", "citation_ids": "" }]; + // } + // Now we have an array in intext_citation + // e.g. [{ key="3NNACKP2", pages=false, citation=""}, { key="S74KCIJR", pages=false, citation=""}] + + // Go through each item in the citation; can be one or more items + var group_authors = []; + + jQuery.each( intext_citation, function( cindex, item ) + { + var item_citation = ""; + var item_authors = ""; + var item_year =""; + + // Add to global array, if not already there + if ( ! window.zpIntextCitations["post-"+item.post_id].hasOwnProperty(item.key) ) + { + window.zpIntextCitations["post-"+item.post_id][item.key] = item; + + // Make sure count for this post exists: + if ( typeof window.zpIntextCitationCount["post-"+item.post_id] === 'undefined') + window.zpIntextCitationCount["post-"+item.post_id] = 0; + + window.zpIntextCitationCount["post-"+item.post_id]++; + window.zpIntextCitations["post-"+item.post_id][item.key]["num"] = window.zpIntextCitationCount["post-"+item.post_id]; + } + //else // If already there, add to item keys -- does this make sense? Just repeats the html id ... + //{ + // window.zpIntextCitations["post-"+item.post_id][item.key]["citation_ids"] += intext_citation_id + " "; + //} + + // Deal with authors and etal + ////jQuery.each( item_data, function ( kindex, response_item ) + ////{ + // if ( response_item.data.key != item.key ) return true; + + if ( item_data.hasOwnProperty(item.key) ) + { + // Deal with authors + if ( item_data[item.key].data.hasOwnProperty("creators") ) + { + var tempAuthorCount = 0; + var tempAuthorTypeExists = false; + + // First, check if there are any Author types + jQuery.each( item_data[item.key].data.creators, function( ai, author ) + { + if ( author.creatorType == "author" ) { + tempAuthorTypeExists = true; + return false; + } + }); + + // Continue, only including non-Author types if no Author types + jQuery.each( item_data[item.key].data.creators, function( ai, author ) + { + if ( tempAuthorTypeExists + && author.creatorType != "author" ) + return true; + + tempAuthorCount++; + + if ( ai != 0 && tempAuthorCount > 1 ) item_authors += ", "; + if ( author.hasOwnProperty("name") ) item_authors += author.name; + else if ( author.hasOwnProperty("lastName") ) item_authors += author.lastName; + }); + + // Deal with duplicates in the group + if ( group_authors.indexOf(item_authors) == -1 ) + group_authors[group_authors.length] = item_authors; + else + item_authors = ""; + + // Create authors array (easier to deal with) + item_authors = item_authors.split(", "); + + // Deal with et al for more than two authors + if ( jQuery.isArray(item_authors) + && item_authors.length > 2 ) + { + if ( intext_citation_params.etal == "" + || intext_citation_params.etal == "default" ) + { + // if ( update == false + // && window.zpIntextCitations["post-"+item.post_id][item.key]["citation_ids"].length > 1 ) + // item_authors = item_authors[0] + " et al."; + } + else if ( intext_citation_params.etal == "yes" ) + { + item_authors = item_authors[0] + " et al."; + } + } + + // Deal with "and" for multiples that are not using "etal" + // NOTE: ampersand [default], and, comma, comma-amp, comma-and + if ( jQuery.isArray(item_authors) + && item_authors.length > 1 + && item_authors.indexOf("et al") == -1 ) + { + var temp_and = " & "; + + if ( intext_citation_params.and == "and" ) + temp_and = " and "; + else if ( intext_citation_params.and == "comma-and" ) + temp_and = ", and "; + else if ( intext_citation_params.and == "comma-amp" ) + temp_and = ", & "; + else if ( intext_citation_params.and == "comma" ) + temp_and = ", "; + else + temp_and = " & "; + + var temp = item_authors.join().replace( /,/g, ", " ); + item_authors = temp.substring( 0, temp.lastIndexOf(", ") ) + temp_and + item_authors[item_authors.length-1]; + } + } + else // Use title if no author + { + item_authors += item_data[item.key].data.title; + } + + // Get year or n.d. + if ( item_data[item.key].meta.hasOwnProperty("parsedDate") ) + item_year = item_data[item.key].meta.parsedDate.substring(0, 4); + else + item_year = "n.d."; + + // Format anchor title attribute + // Apostrophe fix by Chris Wentzloff + window.zpIntextCitations["post-"+item.post_id][item.key]["intexttitle"] = "title='"+JSON.stringify(item_authors).replace( "et al.", "et al." ).replace( /\"/g, "" ).replace( "[", "" ).replace( "]", "" ).replace(/’/g,''').replace(/'/g,''') + " (" + item_year + "). " + item_data[item.key].data.title + ".' "; + + } // if item_data.hasOwnProperty(item.key) + //}); // each request data item + + // Display with numbers + if ( intext_citation_params.format.indexOf("%num%") != -1 ) + { + var default_format = intext_citation_params.format; + + //item_citation = Object.keys(window.zpIntextCitations["post-"+item.post_id]).indexOf( item.key) + 1; + var item_citation_num = window.zpIntextCitations["post-"+item.post_id][item.key]["num"]; + + // If using parenthesis format: + // if ( intext_citation_params.format == "(%num%)" ) + // item_citation = "("+item_citation+")"; + item_citation = intext_citation_params.format.replace( "%num%" , item_citation_num ); + // if ( intext_citation_params.format == "(%num%)" ) + // item_citation = "("+item_citation+")"; + + // Deal with pages + if ( item.pages != false ) + { + var multip = "p. "; + if ( item.pages.indexOf("-") != -1 ) + multip = "pp. "; + + item_citation = item_citation.replace( "%p%" , multip+item.pages ); + } + // Get rid of %p% placeholder, if not used + else + { + item_citation = item_citation.replace( ", %p%" , "" ); + } + + // If more than one item in group, remove ), ( + if ( intext_citation.length > 1 ) + { + if ( cindex != intext_citation.length - 1 ) + item_citation = item_citation.replace( ")", "" ); + + if ( cindex != 0 ) + if ( item_authors == "" ) + item_citation = item_citation.replace( "(, ", "" ); + else + item_citation = item_citation.replace( "(", "" ); + } + + // Deal with brackets + if ( intext_citation_params.brackets ) + { + item_citation = item_citation.replace( "(", "" ); + item_citation = item_citation.replace( ")", "" ); + } + } + + // Display regularly, e.g., author and year and pages + else + { + var default_format = intext_citation_params.format; + + // Add in author + item_citation = intext_citation_params.format.replace( "%a%" , item_authors ); + + // Add in year + item_citation = item_citation.replace( "%d%" , item_year ); + + // Deal with pages + if ( item.pages == false ) + { + item_citation = item_citation.replace( ", %p%" , "" ); + item_citation = item_citation.replace( "%p%" , "" ); + } + else // pages exist + { + item_citation = item_citation.replace( "%p%" , item.pages ); + } + + // If more than one item in group, remove ), ( + if ( default_format == "(%a%, %d%, %p%)" && intext_citation.length > 1 ) + { + if ( cindex != intext_citation.length - 1 ) + item_citation = item_citation.replace( ")", "" ); + + if ( cindex != 0 ) + if ( item_authors == "" ) + item_citation = item_citation.replace( "(, ", "" ); + else + item_citation = item_citation.replace( "(", "" ); + } + + } // non-numerical display + + // Add anchor title and anchors + if ( ! window.zpIntextCitations["post-"+item.post_id][item.key].hasOwnProperty("intexttitle")) + window.zpIntextCitations["post-"+item.post_id][item.key]["intexttitle"] = ""; + + item_citation = "" + item_citation + ""; + + // Deal with + if ( intext_citation_params.format.indexOf("sup") != "-1" ) + item_citation = ""+item_citation+""; + + // Add to intext_citation array + intext_citation[cindex]["intext"] = item_citation; + + }); // format each item + + + + // Format citation group + var intext_citation_pre = ""; if ( intext_citation_params.brackets ) intext_citation_pre = "["; // [ + var intext_citation_post = ""; if ( intext_citation_params.brackets ) intext_citation_post = "]"; // ] + + intext_citation_output = intext_citation_pre; + + jQuery.each( intext_citation, function(cindex, item) + { + // Determine separator + if ( cindex != 0 ) + { + if ( intext_citation_params.separator == "comma" ) + intext_citation_output += ", "; + else + intext_citation_output += "; "; + } + intext_citation_output += item.intext; + + }); // display each item + + intext_citation_output += intext_citation_post; + + // Add to placeholder + // REVIEW: Updated ref to class instead of ID + // jQuery("#"+intext_citation_id).removeClass("loading").html( intext_citation_output ); + jQuery("."+intext_citation_id+":eq("+intext_group_index+")", $postRef ).removeClass("loading").html( intext_citation_output ); + + // REVIEW: Increase group tracker, if needed + if ( intextGroupTracker.hasOwnProperty(intext_citation_id) ) + intextGroupTracker[intext_citation_id]++; + + }); // each intext_citation + + } // zp_format_intext_citations + + + + + function zp_format_intextbib ( $instance, zp_items, zp_itemkeys, params, update ) + { + // var tempItemsArr = {}; // Format: ["itemkey", "data"] + var tempHasNum = false; + var zpPostID = jQuery(".ZP_POSTID", $instance).text(); + var itemNumOrderArr = []; // NOTE: 0 index always empty + + // Disambiguation by Chris Wentzloff + var authDateArray = []; + var alphaArray = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; + + jQuery.each( zp_items.data, function( index, item ) + { + var tempItem = ""; + + // Determine item reference + // e.g., zp-ID-406-1573921-VPACLPQ8 + var $item_ref = jQuery("#"+zp_items.instance+" .zp-List #zp-ID-"+zpPostID+"-"+item.library.id+"-"+item.key); + + // Skip duplicates + // REVIEW: Blocking the rest of formatting, but what about dupes? + // if ( $item_ref.length > 0 ) + // return true; + + // Year + // REVIEW: Now we're using the whole date + var tempItemYear = "0000"; + var tempItemDate = "0000"; + if ( item.meta.hasOwnProperty('parsedDate') ) + tempItemYear = item.meta.parsedDate.substring(0, 4); + if ( item.data.hasOwnProperty('date') ) + tempItemDate = item.data.date; + + // Author + var tempAuthor = item.data.title; + if ( item.meta.hasOwnProperty('creatorSummary') ) + tempAuthor = item.meta.creatorSummary.replace( / /g, "-" ); + + // Title + if ( params.zpTitle == true + && tempTitle != tempItemYear ) + { + tempTitle = tempItemYear; + tempItem += "Abstract: " +item.data.abstractNote+ "
\n"; + + // Add tags, if any + if ( params.zpShowTags == true && + ( item.data.hasOwnProperty('tags') && item.data.tags.length > 0 ) ) + { + tempItem += "Tags: "; + + jQuery.each(item.data.tags, function ( tindex, tag ) + { + tempItem += "" + tag.tag + ""; + if ( tindex != (item.data.tags.length-1) ) tempItem += ", "; + }); + tempItem += "
\n"; + } + + tempItem += "%a%
for author, %d%
for date, "
+"%p%
for page, %num%
for list number.%a%
、日付には%d%
、ページには%p%
"
+"、リスト番号には%num%
を使用してください。[zotpressInTextBib]
shortcode takes the same attributes as "
+"the [zotpress]
shortcode, minus the \"userid,\" \"nickname,\" "
+"and \"limit\" attributes"
+msgstr ""
+"[zotpressInTextBib]
ショートコードは、[zotpress]
"
+"ショートコードと同じ属性から、「userid」、「nickname」、および「limit」の各属性を除いたものを取ります"
+
+#: lib/admin/admin.accounts.addform.php:35
+msgid ""
+"The API User ID for Group accounts can be found on the Zotero Group page. Hover over the title of "
+"a group or click the title of the group to see the URL; the API User ID is "
+"the number in the URL."
+msgstr ""
+"Groupと言うアカウントのAPIユーザーIDは、"
+"Zotero Groupページにあります。 グループのタイトルにカーソルを合わせるか、グループのタイトルをクリックしてURLを表示します。 "
+"APIのユーザーIDはURLにある番号です。"
+
+#: lib/admin/admin.accounts.addform.php:23
+#| msgid ""
+#| "The API User ID for User (individual, personal) accounts "
+#| "can be found on the Zotero Settings > "
+#| "Keys page, right above where you create a new key."
+msgid ""
+"The API User ID for User (individual, personal) accounts "
+"can be found on the Zotero Settings > "
+"Keys page, right above where you create a new key. "
+msgstr ""
+"User(個人)と言うアカウントのAPIユーザーIDは、上の Zotero設定>キーページにあります。あそこで新しい鍵を作成できます。"
+
+#: lib/admin/admin.help.php:95
+msgid "The basic shortcode is"
+msgstr "基本的なショートコードは"
+
+#: lib/admin/admin.help.php:277
+msgid ""
+"Then place the required [zotpressInTextBib]
"
+"shortcode somewhere in your entry after the in-text "
+"citation shortcodes. It will then create the in-text shortcodes and auto-"
+"populate a bibliography where it's placed"
+msgstr ""
+"次に、必須 [zotpressInTextBib]
ショートコードをエントリの"
+"後にテキスト内引用ショートコードのどこかに配置します。 "
+"次に、テキスト内のショートコードを作成し、それが配置されている場所に参考文献を自動入力します"
+
+#: zotpress.php:363
+msgid "There are no citations to display."
+msgstr "引用がありません。"
+
+msgid "There was a Zotpress error:"
+msgstr "Zotpressのエラー:"
+
+#: lib/widget/widget.sidebar.php:233 lib/widget/widget.metabox.php:159
+#: lib/widget/widget.metabox.php:411
+msgid "Title"
+msgstr "タイトル"
+
+#: lib/widget/widget.metabox.php:192 lib/widget/widget.metabox.php:444
+msgid "Title by Year"
+msgstr "年でタイトル"
+
+#: lib/admin/admin.help.php:354
+msgid ""
+"To display your library on the front-end of your website so that visitors "
+"can browse it, use this shortcode on a post or page"
+msgstr "閲覧者が閲覧できるようにウェブサイトのフロントエンドにライブラリーを表示するには、投稿やページにこのショートコードを使用してください"
+
+#: zotpress.php:364 lib/shortcode/shortcode.class.lib.php:267
+msgid "Top Level"
+msgstr "トップレベル"
+
+#: lib/shortcode/shortcode.class.lib.php:378
+msgid "Top Level Items"
+msgstr "トップレベルのアイテム"
+
+#: lib/widget/widget.metabox.php:93 lib/admin/admin.accounts.php:31
+msgid "Type"
+msgstr "タイプ"
+
+#: zotpress.php:391 lib/widget/widget.metabox.php:80 lib/widget/widget.php:165
+#: lib/shortcode/shortcode.class.lib.php:286
+msgid "Type to search"
+msgstr "タイプすると検索する"
+
+#: lib/admin/admin.browse.php:180
+msgid ""
+"Unfortunately, Zotpress ran into an error. Here's what WordPress has to say"
+msgstr "すみませんが、Zotpress には問題が起こったそうです。これが WordPress の言うことです"
+
+#: zotpress.php:367
+msgid "Unset Tag"
+msgstr "タグを解除"
+
+#: lib/admin/admin.help.php:97
+msgid "Use any of the attributes below to customize your bibliography"
+msgstr "参考文献をカスタマイズするには、以下のいずれかの属性を使用できます"
+
+#: lib/admin/admin.help.php:276
+msgid ""
+"Use one or more [zotpressInText]
shortcodes in your post, page "
+"or what-have-you to create placeholders for in-text citations"
+msgstr ""
+"投稿、ページまたはなどなどところに1つ以上の[zotpressInText]
"
+"のショートコードを使って、テキスト引用用のプレースホルダーを作成できます"
+
+#: lib/admin/admin.accounts.php:32
+msgid "User ID"
+msgstr "ユーザー ID"
+
+#: lib/admin/admin.accounts.addform.php:109
+msgid "Validate"
+msgstr "検証"
+
+#: lib/admin/admin.setup.php:12 lib/admin/admin.setup.php:53
+msgid "Validate Account"
+msgstr "アカウントの検証"
+
+#: lib/admin/admin.help.php:11
+msgid "Version"
+msgstr "バージョン"
+
+#: lib/shortcode/shortcode.class.lib.php:372
+msgid "Viewing items tagged"
+msgstr "このタッグからアイテム:"
+
+#: lib/admin/admin.browse.php:137 lib/admin/admin.browse.php:177
+#: lib/admin/admin.setup.php:28
+msgid "Warning"
+msgstr "警告"
+
+#: lib/admin/admin.browse.php:169
+msgid "We successfully connected to WordPress.org"
+msgstr "WordPress.org に接続しました"
+
+#: lib/admin/admin.help.php:12
+msgid "Website"
+msgstr "サイト"
+
+#: lib/admin/admin.browse.php:120
+msgid "Welcome to Zotpress"
+msgstr "Zotpress へようこそ"
+
+#: lib/admin/admin.accounts.php:110
+msgid "What is OAuth?"
+msgstr "OAuthとは何ですか?"
+
+#: lib/admin/admin.help.php:6
+msgid "What is Zotpress"
+msgstr "Zotpress とは"
+
+#: lib/widget/widget.sidebar.php:171
+msgid "Widget Title"
+msgstr "ウィジェットのタイトル"
+
+#: lib/widget/widget.sidebar.php:253 lib/widget/widget.sidebar.php:262
+#: lib/widget/widget.sidebar.php:270 lib/widget/widget.sidebar.php:278
+#: lib/widget/widget.sidebar.php:286 lib/widget/widget.sidebar.php:294
+#: lib/widget/widget.metabox.php:181 lib/widget/widget.metabox.php:194
+#: lib/widget/widget.metabox.php:207 lib/widget/widget.metabox.php:220
+#: lib/widget/widget.metabox.php:233 lib/widget/widget.metabox.php:246
+#: lib/widget/widget.metabox.php:308 lib/widget/widget.metabox.php:319
+#: lib/widget/widget.metabox.php:433 lib/widget/widget.metabox.php:446
+#: lib/widget/widget.metabox.php:459 lib/widget/widget.metabox.php:472
+#: lib/widget/widget.metabox.php:485 lib/widget/widget.metabox.php:498
+msgid "Yes"
+msgstr "はい"
+
+#: lib/admin/admin.help.php:62
+msgid ""
+"You can build shortcodes and search for items in your library using the "
+"Zotpresss Reference widget on the post/page add/edit "
+"screens. Below, you can find attributes and options for each kind of "
+"Zotpress shortcode."
+msgstr ""
+"投稿・ページの追加・編集画面にある「 Zotpressの参照"
+"」ウィジェットを使用して、ショートコードを作成してライブラリー内のアイテムを検索できます。 以下に、Zotpress "
+"の各ショートコードの属性とオプションを示します。"
+
+#: lib/admin/admin.browse.php:184
+msgid ""
+"You can still try to use Zotpress, but it may not work and/or you may "
+"encounter further errors"
+msgstr "引き続き Zotpress の使用を試みることはできますが、機能しない場合や追加エラーが発生する場合があります"
+
+#: lib/admin/admin.help.php:50
+msgid ""
+"You can use Zotpress by creating stand-alone bibliography, applying in-text "
+"citations, displaying your library, or adding a "
+"sidebar widget to your theme."
+msgstr ""
+"Zotpressを使用することは、"
+"スタンドアロン書誌を作ったり、"
+"本文引用 を使ったら、"
+"ライブラリーを見せたら、チームでサイドバーウィジェットを使うことです。"
+
+#: lib/admin/admin.help.php:11
+msgid "You're using"
+msgstr "使っているバージョンは"
+
+#: lib/admin/admin.accounts.addform.php:103
+msgid ""
+"Your API User ID can be hard to remember. Make it easier for yourself by "
+"giving your account a nickname."
+msgstr "APIのユーザーIDは覚えにくい場合がありますね。 自分のアカウントにニックネームを付けることで、より簡単にできます。"
+
+#: lib/admin/admin.browse.php:75
+msgid "Your Library"
+msgstr "あなたのライブラリー"
+
+#: lib/admin/admin.browse.php:143
+msgid ""
+"Your system meets the requirements necessary for Zotpress to communicate "
+"with Zotero from WordPress"
+msgstr "システムは Zotpress が WordPress から Zotero と通信するのに必要な要件を満たします"
+
+#: zotpress.php:193
+msgid "Your Zotero account has been validated."
+msgstr "Zotero アカウントが有効になっています。"
+
+#: lib/admin/admin.browse.php:109
+msgid "Zotero + WordPress = Zotpress"
+msgstr "Zotero + WordPress = Zotpress"
+
+#. Name of the plugin
+msgid "Zotpress"
+msgstr "Zotpress"
+
+#: lib/widget/widget.php:21
+msgid "Zotpress Reference"
+msgstr "Zotpress の参照"
+
+#: lib/admin/admin.setup.php:28
+msgid ""
+"Zotpress requires at least one of the following to work: cURL, fopen with "
+"Streams (PHP 5), or fsockopen. You will not be able to use Zotpress until "
+"your administrator or tech support has set up one of these options. cURL is "
+"recommended."
+msgstr ""
+"Zotpress では、cURL、Streams(PHP 5)、または fsockopen で fopen "
+"を実行するには、少なくとも次のいずれかが必要です。管理者または技術サポートがこれらのオプションの1つを設定するまで、Zotpress "
+"を使用することはできません。cURL が推奨されます。"
+
+#: lib/admin/admin.browse.php:137
+msgid ""
+"Zotpress requires at least one of the following: cURL, fopen with "
+"Streams (PHP 5), or fsockopen. You will not be able to import items "
+"until your administrator or tech support has set up one of these options. "
+"cURL is recommended."
+msgstr ""
+"Zotpress には、少なくとも次のいずれかが必要です:cURL, fopen と Streams 付き(PHP 5)または "
+"fsockopen "
+"。管理者または技術サポートがこれらのオプションのいずれかを設定するまで、アイテムをインポートすることはできません。cURL をお勧めします。"
+
+#: lib/admin/admin.help.php:448
+msgid "Zotpress Support Forums"
+msgstr "Zotpress サポートフォーラム"
+
+#: lib/admin/admin.browse.php:177
+msgid "Zotpress was not able to connect to WordPress.org"
+msgstr "Zotpress は WordPress.org に接続できませんでした"
+
+#: lib/widget/widget.sidebar.php:11
+msgid "Zotpress Widget"
+msgstr "Zotpress ウィジェット"
+
+#: lib/admin/admin.php:9
+msgid "Zotpress: 403 Access Denied"
+msgstr "Zotpress: 403 アクセスが拒否されました"
diff --git a/languages/zotpress.pot b/languages/zotpress.pot
new file mode 100644
index 0000000..5d46a96
--- /dev/null
+++ b/languages/zotpress.pot
@@ -0,0 +1,975 @@
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: Zotpress\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2021-02-11 07:38+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME %a%
for author, %d%
for date, "
+"%p%
for page, %num%
for list number.[zotpressInTextBib]
shortcode takes the same attributes as "
+"the [zotpress]
shortcode, minus the \"userid,\" \"nickname,\" "
+"and \"limit\" attributes"
+msgstr ""
+
+#: lib/admin/admin.accounts.addform.php:35
+#, php-format
+msgid ""
+"The API User ID for Group accounts can be found on the Zotero Group page. Hover over the title of "
+"a group or click the title of the group to see the URL; the API User ID is "
+"the number in the URL."
+msgstr ""
+
+#: lib/admin/admin.accounts.addform.php:23
+#, php-format
+msgid ""
+"The API User ID for User (individual, personal) accounts "
+"can be found on the Zotero Settings > "
+"Keys page, right above where you create a new key. "
+msgstr ""
+
+#: lib/admin/admin.help.php:95
+msgid "The basic shortcode is"
+msgstr ""
+
+#: lib/admin/admin.help.php:277
+msgid ""
+"Then place the required [zotpressInTextBib]
"
+"shortcode somewhere in your entry after the in-text "
+"citation shortcodes. It will then create the in-text shortcodes and auto-"
+"populate a bibliography where it's placed"
+msgstr ""
+
+#: zotpress.php:363
+msgid "There are no citations to display."
+msgstr ""
+
+#: lib/widget/widget.sidebar.php:233 lib/widget/widget.metabox.php:159
+#: lib/widget/widget.metabox.php:411
+msgid "Title"
+msgstr ""
+
+#: lib/widget/widget.metabox.php:192 lib/widget/widget.metabox.php:444
+msgid "Title by Year"
+msgstr ""
+
+#: lib/admin/admin.help.php:354
+msgid ""
+"To display your library on the front-end of your website so that visitors "
+"can browse it, use this shortcode on a post or page"
+msgstr ""
+
+#: zotpress.php:364 lib/shortcode/shortcode.class.lib.php:267
+msgid "Top Level"
+msgstr ""
+
+#: lib/shortcode/shortcode.class.lib.php:378
+msgid "Top Level Items"
+msgstr ""
+
+#: lib/widget/widget.metabox.php:93 lib/admin/admin.accounts.php:31
+msgid "Type"
+msgstr ""
+
+#: zotpress.php:391 lib/widget/widget.metabox.php:80 lib/widget/widget.php:165
+#: lib/shortcode/shortcode.class.lib.php:286
+msgid "Type to search"
+msgstr ""
+
+#: lib/admin/admin.browse.php:180
+msgid ""
+"Unfortunately, Zotpress ran into an error. Here's what WordPress has to say"
+msgstr ""
+
+#: zotpress.php:367
+msgid "Unset Tag"
+msgstr ""
+
+#: lib/admin/admin.help.php:97
+msgid "Use any of the attributes below to customize your bibliography"
+msgstr ""
+
+#: lib/admin/admin.help.php:276
+msgid ""
+"Use one or more [zotpressInText]
shortcodes in your post, page "
+"or what-have-you to create placeholders for in-text citations"
+msgstr ""
+
+#: lib/admin/admin.accounts.php:32
+msgid "User ID"
+msgstr ""
+
+#: lib/admin/admin.accounts.addform.php:109
+msgid "Validate"
+msgstr ""
+
+#: lib/admin/admin.setup.php:12 lib/admin/admin.setup.php:53
+msgid "Validate Account"
+msgstr ""
+
+#: lib/admin/admin.help.php:11
+msgid "Version"
+msgstr ""
+
+#: lib/shortcode/shortcode.class.lib.php:372
+msgid "Viewing items tagged"
+msgstr ""
+
+#: lib/admin/admin.browse.php:137 lib/admin/admin.browse.php:177
+#: lib/admin/admin.setup.php:28
+msgid "Warning"
+msgstr ""
+
+#: lib/admin/admin.browse.php:169
+msgid "We successfully connected to WordPress.org"
+msgstr ""
+
+#: lib/admin/admin.help.php:12
+msgid "Website"
+msgstr ""
+
+#: lib/admin/admin.browse.php:120
+msgid "Welcome to Zotpress"
+msgstr ""
+
+#: lib/admin/admin.accounts.php:110
+msgid "What is OAuth?"
+msgstr ""
+
+#: lib/admin/admin.help.php:6
+msgid "What is Zotpress"
+msgstr ""
+
+#: lib/widget/widget.sidebar.php:171
+msgid "Widget Title"
+msgstr ""
+
+#: lib/widget/widget.sidebar.php:253 lib/widget/widget.sidebar.php:262
+#: lib/widget/widget.sidebar.php:270 lib/widget/widget.sidebar.php:278
+#: lib/widget/widget.sidebar.php:286 lib/widget/widget.sidebar.php:294
+#: lib/widget/widget.metabox.php:181 lib/widget/widget.metabox.php:194
+#: lib/widget/widget.metabox.php:207 lib/widget/widget.metabox.php:220
+#: lib/widget/widget.metabox.php:233 lib/widget/widget.metabox.php:246
+#: lib/widget/widget.metabox.php:308 lib/widget/widget.metabox.php:319
+#: lib/widget/widget.metabox.php:433 lib/widget/widget.metabox.php:446
+#: lib/widget/widget.metabox.php:459 lib/widget/widget.metabox.php:472
+#: lib/widget/widget.metabox.php:485 lib/widget/widget.metabox.php:498
+msgid "Yes"
+msgstr ""
+
+#: lib/admin/admin.help.php:62
+msgid ""
+"You can build shortcodes and search for items in your library using the "
+"Zotpresss Reference widget on the post/page add/edit "
+"screens. Below, you can find attributes and options for each kind of "
+"Zotpress shortcode."
+msgstr ""
+
+#: lib/admin/admin.browse.php:184
+msgid ""
+"You can still try to use Zotpress, but it may not work and/or you may "
+"encounter further errors"
+msgstr ""
+
+#: lib/admin/admin.help.php:50
+#, php-format
+msgid ""
+"You can use Zotpress by creating stand-alone bibliography, applying in-text "
+"citations, displaying your library, or adding a "
+"sidebar widget to your theme."
+msgstr ""
+
+#: lib/admin/admin.help.php:11
+msgid "You're using"
+msgstr ""
+
+#: lib/admin/admin.accounts.addform.php:103
+msgid ""
+"Your API User ID can be hard to remember. Make it easier for yourself by "
+"giving your account a nickname."
+msgstr ""
+
+#: lib/admin/admin.browse.php:75
+msgid "Your Library"
+msgstr ""
+
+#: lib/admin/admin.browse.php:143
+msgid ""
+"Your system meets the requirements necessary for Zotpress to communicate "
+"with Zotero from WordPress"
+msgstr ""
+
+#: zotpress.php:193
+msgid "Your Zotero account has been validated."
+msgstr ""
+
+#: lib/admin/admin.browse.php:109
+msgid "Zotero + WordPress = Zotpress"
+msgstr ""
+
+#. Name of the plugin
+msgid "Zotpress"
+msgstr ""
+
+#: lib/widget/widget.php:21
+msgid "Zotpress Reference"
+msgstr ""
+
+#: lib/admin/admin.setup.php:28
+msgid ""
+"Zotpress requires at least one of the following to work: cURL, fopen with "
+"Streams (PHP 5), or fsockopen. You will not be able to use Zotpress until "
+"your administrator or tech support has set up one of these options. cURL is "
+"recommended."
+msgstr ""
+
+#: lib/admin/admin.browse.php:137
+msgid ""
+"Zotpress requires at least one of the following: cURL, fopen with "
+"Streams (PHP 5), or fsockopen. You will not be able to import items "
+"until your administrator or tech support has set up one of these options. "
+"cURL is recommended."
+msgstr ""
+
+#: lib/admin/admin.help.php:448
+msgid "Zotpress Support Forums"
+msgstr ""
+
+#: lib/admin/admin.browse.php:177
+msgid "Zotpress was not able to connect to WordPress.org"
+msgstr ""
+
+#: lib/widget/widget.sidebar.php:11
+msgid "Zotpress Widget"
+msgstr ""
+
+#: lib/admin/admin.php:9
+msgid "Zotpress: 403 Access Denied"
+msgstr ""
+
+msgid "There was a Zotpress error:"
+msgstr ""
+
+msgid "No items found."
+msgstr ""
diff --git a/lib/actions/actions.autoupdate.php b/lib/actions/actions.autoupdate.php
deleted file mode 100644
index ff83ea7..0000000
--- a/lib/actions/actions.autoupdate.php
+++ /dev/null
@@ -1,216 +0,0 @@
- 403 ) );
-
- // Ignore user abort
- ignore_user_abort(true);
- set_time_limit(60*10); // ten minutes
-
- // Access WordPress db
- global $wpdb;
-
- // Include Request Functionality
- require("../request/rss.request.php");
-
- // Include Import and Sync Functions
- require("../import/import.functions.php");
- require("../import/sync.functions.php");
-
- // Get session ready
- if (!session_id()) { session_start(); }
-
-
-?>
-
-
-
-
- Redirecting to Zotero to authenticate.
"; echo $redirect; - + break; - + case 1: // State 1 - Handle callback from Zotero and get and store an access token // Make sure the token we got sent back matches the one we have @@ -190,32 +190,35 @@ function get_access_token($state){ } // Continue on to authorized state outside switch break; - + case 2: //get previously stored access token if we didn't just get it from a handshack $access_token_info = get_access_token($state); break; } - - if (isset( $access_token_info )) + + if ( isset( $access_token_info ) ) { // ADD PRIVATE KEY TO THE USER'S ACCOUNT IN ZOTPRESS global $wpdb; + $api_user_id = $_GET['oauth_user']; $query = "UPDATE ".$wpdb->prefix."zotpress "; - $query .= "SET public_key='".$access_token_info['oauth_token_secret']."' WHERE api_user_id='".$_GET['oauth_user']."';"; + $query .= $wpdb->prepare("SET public_key='".$access_token_info['oauth_token_secret']."' WHERE api_user_id=%d", $api_user_id); $wpdb->query($query); - + + eb_zotpress_refresh_account($api_user_id); + // EMPTY THE CACHE $oa_cache = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."zotpress_oauth"); $query = "UPDATE ".$wpdb->prefix."zotpress_oauth "; $query .= "SET cache='empty' WHERE id='".$oa_cache[0]->id."';"; $wpdb->query($query); - + // CLOSE AND REFRESH PAGE $finish = ' '; echo $finish; } - - ?> \ No newline at end of file + +?> diff --git a/lib/admin/admin.accounts.php b/lib/admin/admin.accounts.php index e5ab390..04a6613 100644 --- a/lib/admin/admin.accounts.php +++ b/lib/admin/admin.accounts.php @@ -5,117 +5,124 @@ { // Determine if server supports OAuth - if (in_array ('oauth', get_loaded_extensions())) { $oauth_is_not_installed = false; } else { $oauth_is_not_installed = true; } - - if (isset( $_GET['oauth'] )) { include("admin.accounts.oauth.php"); } else { - + $oauth_is_not_installed = ! in_array( 'oauth', get_loaded_extensions() ); + + if ( isset( $_GET['oauth'] ) ) + { + include(__DIR__ . "/admin.accounts.oauth.php"); + + } else { + ?> - +Default | -Type | -User ID | -Private Key | -Nickname | - -Actions | ++ | + | + | + | + | + | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Set as Default | \n"; - + $code .= ""; + // if ( get_option("Zotpress_DefaultAccount") && get_option("Zotpress_DefaultAccount") == $account->api_user_id ) $code .= " selected"; + $code .= "".__('Set as Default','zotpress')." | \n"; + // ACCOUNT TYPE $code .= "" . substr($account->account_type, 0, -1) . " | \n"; - + // API USER ID $code .= "" . $account->api_user_id . " | \n"; - - // PUBLIC KEY - $code .= ""; + + // PRIVATE KEY + $code .= " | "; if ($account->public_key) { $code .= $account->public_key; } else { - $code .= 'No private key entered. Start OAuth?'; + add_thickbox(); + $code .= 'No private key entered. '.__('Start OAuth','zotpress').'?'; } $code .= " | \n"; - + // NICKNAME $code .= ""; if ($account->nickname) $code .= $account->nickname; $code .= " | \n"; - - // ACTIONS - $code .= "\n"; - //$code .= " Sync\n"; - $code .= " Selective Import\n"; - $code .= " Import\n"; - $code .= " Remove\n"; - //$code .= " \n"; + + // CACHE + $code .= " | \n"; + $code .= " ".__('Clear Cache','zotpress')."\n"; $code .= " | \n"; - + + // REMOVE + $code .= "\n"; + $code .= " ".__('Remove','zotpress')."\n"; + $code .= " | \n"; + $code .= "
OAuth helps you create the necessary private key for allowing Zotpress to read your Zotero library and display it for all to see. You can do this manually through the Zotero website; using OAuth in Zotpress is just a quicker, more straightforward way of going about it. Note: You'll need to have OAuth installed on your server to use this option. If you don't have OAuth installed, you'll have to generate a private key manually through the Zotero website.
- - + +".__("Sorry, you don't have permission to access this page.","zotpress")."
"; } -?> \ No newline at end of file +?> diff --git a/lib/admin/admin.browse.php b/lib/admin/admin.browse.php index 1c9038a..a63da26 100644 --- a/lib/admin/admin.browse.php +++ b/lib/admin/admin.browse.php @@ -1,262 +1,216 @@ get_results("SELECT * FROM ".$wpdb->prefix."zotpress ORDER BY account_type DESC"); - $zp_accounts_total = $wpdb->num_rows; - - + + $zp_accounts_total = zp_get_total_accounts( $wpdb ); + $zp_account = false; + $api_user_id = false; + // Display Browse page if there's at least one Zotero account synced - if ( $zp_accounts_total > 0 ) { - // FILTER PARAMETERS - - // API User ID - - global $api_user_id; - $account_name = false; - - if ( isset($_GET['api_user_id']) && preg_match("/^[0-9]+$/", $_GET['api_user_id']) ) - { - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress WHERE api_user_id='".$_GET['api_user_id']."'", OBJECT); - $api_user_id = $zp_account->api_user_id; - $account_name = $zp_account->nickname; - } - else - { - if ( get_option("Zotpress_DefaultAccount") ) - { - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress WHERE api_user_id='".get_option("Zotpress_DefaultAccount")."'", OBJECT); - - if ( count($zp_account) > 0 ) - { - $api_user_id = $zp_account->api_user_id; - $account_name = $zp_account->nickname; - } - else - { - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress LIMIT 1"); - - if (count($zp_account) > 0) - { - $account_name = $zp_account->nickname; - $account_type = $zp_account->account_type; - $api_user_id = $zp_account->api_user_id; - $public_key = $zp_account->public_key; - $nickname = $zp_account->nickname; - } - else - { - $api_user_id = false; - } - } - } - else - { - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress LIMIT 1"); - - if (count($zp_account) > 0) - { - $account_name = $zp_account->nickname; - $account_type = $zp_account->account_type; - $api_user_id = $zp_account->api_user_id; - $public_key = $zp_account->public_key; - $nickname = $zp_account->nickname; - } - else - { - $api_user_id = false; - } + if ( isset($_GET['api_user_id']) + && preg_match("/^\\d+\$/", $_GET['api_user_id']) ) + { + $zp_account_temp = eb_zotpress_get_account($_GET['api_user_id']); + + if ( (array)$zp_account_temp !== [] ) + { + $zp_account = $zp_account_temp; + $api_user_id = $zp_account->api_user_id; + } + } + elseif ( get_option("Zotpress_DefaultAccount") ) + { + $zp_account_temp = eb_zotpress_get_account(get_option("Zotpress_DefaultAccount")); + + if ( (array)$zp_account_temp !== [] ) + { + $zp_account = $zp_account_temp; + $api_user_id = $zp_account->api_user_id; + } + else + { + $zp_account_temp = eb_zotpress_get_account(); + + if ( (array)$zp_account_temp !== [] ) + { + $zp_account = $zp_account_temp; + $api_user_id = $zp_account->api_user_id; + } + } + } + + else + { + $zp_account_temp = eb_zotpress_get_account(); + + if ( ( is_array($zp_account_temp) + || is_object($zp_account_temp) + || $zp_account_temp instanceof Countable ) + && (array)$zp_account_temp !== [] ) + { + $zp_account = $zp_account_temp; + $api_user_id = $zp_account->api_user_id; } } - - - // ACCOUNT DEFAULTS - - if (count($zp_account) == 1) - { - $account_type = $zp_account->account_type; - $api_user_id = $zp_account->api_user_id; - $public_key = $zp_account->public_key; - $nickname = $zp_account->nickname; - } - - + + // Use Browse class - - $zpLib = new zotpressBrowse; + $zpLib = new zotpressLib; $zpLib->setAccount($zp_account); $zpLib->setType("dropdown"); + $zpLib->setAdmin(true); + $zpLib->setShowImage(true); ?> - +- Before we get started, let's make sure your system can support Zotpress: + :
- + - +Warning: Zotpress requires at least one of the following: cURL, fopen with Streams (PHP 5), or fsockopen. You will not be able to import items until your administrator or tech support has set up one of these options. cURL is recommended.
+: cURL, fopen with Streams (PHP 5), or fsockopen. You will not be able to import items until your administrator or tech support has set up one of these options. cURL is recommended.','zotpress'); ?>
Hurrah! Your system meets the requirements necessary for Zotpress to communicate with Zotero from WordPress.
+! .
Sometimes systems aren't configured to allow communication with external websites. Let's check by accessing WordPress.org: - + +
: + array("Zotero-API-Version: 2") ) ); - + if ( $response["response"]["code"] == 200 ) { ?> - + - +
Great! We successfully connected to WordPress.org.
+! .
Everything appears to check out. Let's continue setting up Zotpress by adding your Zotero account. Click "Next." - + +
+ - +
Warning: Zotpress was not able to connect to WordPress.org.
+: .
Unfortunately, Zotpress ran into an error. Here's what WordPress has to say: get_error_message(); } else { echo "Sorry, but there's no details on the error." ; } ?>
- -First, try reloading. If the error recurs, your system may not be set up to run Zotpress. Please contact your system administrator or website host and ask about allowing PHP scripts to access content like RSS feeds from external websites through cURL, fopen with Streams (PHP 5), or fsockopen.
- -You can still try to use Zotpress, but it may not work and/or you may encounter further errors.
- + +: get_error_message(); } else { echo __("Sorry, but there's no details on the error",'zotpress'); } ?>.
+ +.
+ +.
+ - + - +Note: Only applicable if you have multiple synced Zotero accounts.
- -Note: Styles must be listed here. Use the name found in the style's URL, e.g. modern-language-association.
- -Have Zotpress automatically sync your Zotero accounts.
- -here. Use the name found in the style\'s URL, e.g. modern-language-association.', 'zotpress' ), + array( + 'a' => array( + 'href' => array() + ) + ) + ), esc_url( 'http://www.zotero.org/styles' ) + ); ?> +
+ +Enable or disable the word processor-like features in the rich text editor.
- -Enable or disable the Zotpress Reference widget for specific post types.
- + + + + +Note: This action will clear all database entries associated with Zotpress, including account information and citations—it cannot be undone. Proceed with caution.
- + + + +cannot be undone. Proceed with caution.','zotpress'); ?>
+"._e("Sorry, you don't have permission to access this page.","zotpress")."
"; } -?> \ No newline at end of file +?> diff --git a/lib/admin/admin.php b/lib/admin/admin.php index 16295ee..710c0ad 100644 --- a/lib/admin/admin.php +++ b/lib/admin/admin.php @@ -1,70 +1,556 @@ - 403 ) ); - - - - // SETUP AND IMPORT PAGES - - if (isset($_GET['setup'])) - { - include( dirname(__FILE__) . '/admin.setup.php' ); - } - - else if (isset($_GET['import'])) - { - include( dirname(__FILE__) . '/../import/import.php' ); - } - - else if (isset($_GET['selective'])) - { - include( dirname(__FILE__) . '/../import/import.selective.php' ); - } - - - - - // ACCOUNTS PAGE - - else if (isset($_GET['accounts'])) - { - include( dirname(__FILE__) . '/admin.accounts.php' ); - } - - - - // OPTIONS PAGE - - else if (isset($_GET['options'])) - { - include( dirname(__FILE__) . '/admin.options.php' ); - } - - - - // HELP PAGE - - else if (isset($_GET['help'])) - { - include( dirname(__FILE__) . '/admin.help.php' ); - } - - - - // BROWSE PAGE - - else - { - include( dirname(__FILE__) . '/admin.browse.php' ); - } - } - -// END ADMIN ------------------------------------------------------------------------------------------ - -?> \ No newline at end of file + 403 ) ); + + + // +--------------------+ + // | Set up admin pages | + // +--------------------+ + + if (isset($_GET['setup'])) { + include( dirname(__FILE__) . '/admin.setup.php' ); + } elseif (isset($_GET['accounts'])) { + include( dirname(__FILE__) . '/admin.accounts.php' ); + } elseif (isset($_GET['options'])) { + include( dirname(__FILE__) . '/admin.options.php' ); + } elseif (isset($_GET['help'])) { + include( dirname(__FILE__) . '/admin.help.php' ); + } else { + include( dirname(__FILE__) . '/admin.browse.php' ); + } +} + + +function zp_Get_Default_Style() +{ + $zp_default_style = "apa"; + if (get_option("Zotpress_DefaultStyle")) + $zp_default_style = get_option("Zotpress_DefaultStyle"); + + return $zp_default_style; +} + + +function Zotpress_process_accounts_AJAX() +{ + check_ajax_referer( 'zpAccountsAJAX_nonce_val', 'zpAccountsAJAX_nonce' ); + + global $wpdb; + + include( dirname(__FILE__) . '/../request/request.functions.php' ); + + $xml = ""; + + + // +-------------+ + // | ADD ACCOUNT | + // +-------------+ + + if ( isset($_GET['action_type']) + && $_GET['action_type'] == "add_account" ) + { + // Set up error array + $errors = + array( + "api_user_id_blank"=>array(0,"User ID was left blank."), + "api_user_id_format"=>array(0,"User ID was formatted incorrectly."), + "public_key_blank"=>array(0,"Public Key was left blank."), + "public_key_format"=>array(0,"Public Key was formatted incorrectly."), + "nickname_format"=>array(0,"Nickname was formatted incorrectly.") + ); + + // ACCOUNT TYPE + if ($_GET['account_type'] != "") + $account_type = $_GET['account_type'] == "groups" ? "groups" : "users"; + else + $account_type = "users"; + + // API USER ID + if ($_GET['api_user_id'] != "") + if (preg_match("/^\\d+\$/", $_GET['api_user_id']) == 1) + $api_user_id = htmlentities($_GET['api_user_id']); + else + $errors['api_user_id_format'][0] = 1; + else + $errors['api_user_id_blank'][0] = 1; + + // PUBLIC KEY + $public_key = false; + + if ($_GET['public_key'] != "") + if (preg_match("/^[0-9a-zA-Z]+$/", $_GET['public_key']) == 1) { + $public_key = htmlentities(trim($_GET['public_key'])); + } elseif ($account_type == "users") { + $errors['public_key_format'][0] = 1; + } elseif ($account_type == "users") { + $errors['public_key_blank'][0] = 1; + } + + // NICKNAME + $nickname = false; + if (isset($_GET['nickname']) && trim($_GET['nickname']) != '') + if (preg_match('/^[\'0-9a-zA-Z -_]+$/', stripslashes($_GET['nickname'])) == 1) + $nickname = str_replace("'", "", str_replace(" ", "", trim(urldecode($_GET['nickname'])))); + else + $errors['nickname_format'][0] = 1; + + // CHECK ERRORS + $errorCheck = false; + foreach ($errors as $field => $error) + { + if ( $error[0] == 1 ) { + $errorCheck = true; + break; + } + } + + // ADD ACCOUNT + if ($errorCheck == false) + { + $data = array($account_type, $api_user_id, $public_key); + if($nickname) { + $data[] = $nickname; + } + $query = "INSERT INTO ".$wpdb->prefix."zotpress (account_type, api_user_id, public_key"; + if ($nickname) $query .= ", nickname"; + $query .= ") "; + $query .= "VALUES (".eb_zotpress_escape_array($data).")"; + + // Insert new list item into the list: + $wpdb->query($query); + + // Display success XML + $xml .= "Warning. Zotpress requires at least one of the following to work: cURL, fopen with Streams (PHP 5), or fsockopen. You will not be able to import items until your administrator or tech support has set up one of these options. cURL is recommended.
-- The importing process might take a few minutes, depending on what you choose to import and the size of your Zotero library. -
- -- Alternatively, you can selectively import top-level collections below. You may need to wait a few moments if you have several top-level collections. -
- -!
+Sorry, no collections to display.
"; - } - - $output .= "\n"; - - echo $output; - - // Unset - $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'] = array(); - $GLOBALS['zp_session'][$api_user_id]['collections']['query_total_entries'] = 0; - -} // nonce - -?> \ No newline at end of file diff --git a/lib/import/import.functions.php b/lib/import/import.functions.php deleted file mode 100644 index 93685e4..0000000 --- a/lib/import/import.functions.php +++ /dev/null @@ -1,1271 +0,0 @@ - 0 ): - preg_match_all( '/(\d{4})/', $date, $matches ); - if ( isset($matches[0][0]) ): - return $matches[0][0]; - else: - return ""; - endif; - else: - return ""; - endif; - } - - - - function zp_set_update_time ($time) - { - update_option("Zotpress_LastAutoUpdate", $time); - } - - - - function zp_get_api_user_id ($api_user_id_incoming=false) - { - if (isset($_GET['api_user_id']) && preg_match("/^[0-9]+$/", $_GET['api_user_id']) == 1) - $api_user_id = htmlentities($_GET['api_user_id']); - else if ($api_user_id_incoming !== false) - $api_user_id = $api_user_id_incoming; - else - $api_user_id = false; - - return $api_user_id; - } - - - - function zp_get_account ($wpdb, $api_user_id_incoming=false) - { - if ($api_user_id_incoming !== false) - $zp_account = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."zotpress WHERE api_user_id='".$api_user_id_incoming."'"); - else - $zp_account = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."zotpress ORDER BY id DESC LIMIT 1"); - - return $zp_account; - } - - - - function zp_get_accounts ($wpdb) - { - $zp_accounts = $wpdb->get_results("SELECT api_user_id FROM ".$wpdb->prefix."zotpress"); - - return $zp_accounts; - } - - - - //function zp_delete_collection ($term_id) - //{ - // wp_delete_term( $term_id, 'zp_collections' ); - // delete_option( 'zp_collection-'.$term_id.'-api_user_id' ); - // delete_option( 'zp_collection-'.$term_id.'-retrieved' ); - // delete_option( 'zp_collection-'.$term_id.'-parent' ); - // delete_option( 'zp_collection-'.$term_id.'-item_key' ); - // delete_option( 'zp_collection-'.$term_id.'-numCollections' ); - // delete_option( 'zp_collection-'.$term_id.'-numItems' ); - // delete_option( 'zp_collection-'.$term_id.'-items' ); - //} - // - // - // - //function zp_delete_tag ($term_id) - //{ - // wp_delete_term( $term_id, 'zp_tags' ); - // delete_option( 'zp_tag-'.$term_id.'-api_user_id' ); - // delete_option( 'zp_tag-'.$term_id.'-retrieved' ); - // delete_option( 'zp_tag-'.$term_id.'-numItems' ); - // delete_option( 'zp_tag-'.$term_id.'-items' ); - //} - - - // Function to recursively delete collections and their items - function zp_selectively_delete_collection ( $wpdb, $api_user_id, $collection ) - { - $collection_item_list = array(); - - // First, get items - $items = $wpdb->get_results( - " - SELECT ".$wpdb->prefix."zotpress_zoteroRelItemColl.item_key - FROM ".$wpdb->prefix."zotpress_zoteroRelItemColl - WHERE api_user_id='".$api_user_id."' - AND ".$wpdb->prefix."zotpress_zoteroRelItemColl.collection_key='".$collection."' - ", - OBJECT - ); - - if ( count($items) > 0 ) - { - foreach ( $items as $item ) - { - // Remember item to check tags later - $collection_item_list[count($collection_item_list)] = $item->item_key; - - // Delete item's children - $wpdb->query( - " - DELETE FROM ".$wpdb->prefix."zotpress_zoteroItems - WHERE api_user_id='".$api_user_id."' AND parent='".$item->item_key."' - " - ); - } - // Then delete items - $wpdb->query( - " - DELETE FROM ".$wpdb->prefix."zotpress_zoteroItems - WHERE api_user_id='".$api_user_id."' AND item_key IN ( '".implode("','", $collection_item_list)."' ) - " - ); - // And their relationships with collections - $wpdb->query( - " - DELETE FROM ".$wpdb->prefix."zotpress_zoteroRelItemColl - WHERE api_user_id='".$api_user_id."' AND item_key IN ( '".implode("','", $collection_item_list)."' ) - " - ); - } - - unset( $items ); - - // Then delete collection - $wpdb->query( - $wpdb->prepare( - " - DELETE FROM ".$wpdb->prefix."zotpress_zoteroCollections WHERE api_user_id='%s' AND item_key='%s' - ", - $api_user_id, $collection - ) - ); - - // Next, delete subcollections - $subcollections = $wpdb->get_results( - " - SELECT item_key FROM ".$wpdb->prefix."zotpress_zoteroCollections - WHERE api_user_id='".$api_user_id."' AND parent='".$collection."' - " - ); - - if ( count($subcollections) > 0 ) - { - foreach ( $subcollections as $subcollection ) - { - $temp = zp_selectively_delete_collection( $wpdb, $api_user_id, $subcollection->item_key ); - - if ( $temp ) $GLOBALS['zp_session'][$api_user_id]['collection_item_list'] = array_merge( $temp, $GLOBALS['zp_session'][$api_user_id]['collection_item_list'] ); - } - } - - unset( $subcollections ); - - if ( count($collection_item_list) > 0) return $collection_item_list; else return false; - } - - - - function zp_clear_last_import ($wpdb, $api_user_id, $step, $collections=false) - { - switch ($step) - { - case "items": - $wpdb->query("DELETE FROM ".$wpdb->prefix."zotpress_zoteroItems WHERE api_user_id='".$api_user_id."'"); - $wpdb->query("DELETE FROM ".$wpdb->prefix."zotpress_zoteroRelItemColl WHERE api_user_id='".$api_user_id."'"); - $wpdb->query("DELETE FROM ".$wpdb->prefix."zotpress_zoteroRelItemTags WHERE api_user_id='".$api_user_id."'"); - //$zp_entry_array = get_posts( - // array( - // 'posts_per_page' => -1, - // 'post_type' => 'zp_entry', - // 'meta_key' => 'api_user_id', - // 'meta_value' => $api_user_id - // ) - //); - //foreach ($zp_entry_array as $zp_entry) wp_delete_post( $zp_entry->ID, true ); - break; - - case "collections": - $wpdb->query("DELETE FROM ".$wpdb->prefix."zotpress_zoteroCollections WHERE api_user_id='".$api_user_id."'"); - //$zp_collections_array = get_terms( - // 'zp_collections', - // array( - // 'hide_empty' => false - // ) - //); - //foreach ($zp_collections_array as $zp_collection_term) - // if ( get_option( 'zp_collection-'.$zp_collection_term->term_id.'-api_user_id' ) ) - // zp_delete_collection ($zp_collection_term->term_id); - break; - - case "tags": - $wpdb->query("DELETE FROM ".$wpdb->prefix."zotpress_zoteroTags WHERE api_user_id='".$api_user_id."'"); - //$zp_tags_array = get_terms( - // 'zp_tags', - // array( - // 'hide_empty' => false - // ) - //); - //foreach ($zp_tags_array as $zp_tag_term) - // if ( get_option( 'zp_tag-'.$zp_tag_term->term_id.'-api_user_id' ) ) - // zp_delete_tag ($zp_tag_term->term_id); - break; - - case "selective": - if ( $collections !== false ) - { - $collection_item_list = array(); // for tags - //$collections = str_replace( ",", "', '", $collections ); - //$collections = explode( ",", $collections ); - //$all_top_level_collections = get_terms( 'zp_collections', array( 'hide_empty' => false, 'parent' => 0 ) ); - //$all_top_level_collections = $wpdb->get_results( - // " - // SELECT item_key FROM ".$wpdb->prefix."zotpress_zoteroCollections - // WHERE api_user_id='".$api_user_id."' AND item_key IN ( '".$collections."' ) - // " - //); - $collections = explode(",", $collections); - $GLOBALS['zp_session'][$api_user_id]['collection_item_list'] = array(); - - // Delete selected top level collection, items, subcollections and their items - if ( count($collections) > 0 ) - { - foreach ( $collections as $top_level_collection ) - { - $temp = zp_selectively_delete_collection( $wpdb, $api_user_id, $top_level_collection ); - - if ( $temp ) $collection_item_list = array_merge( $temp, $collection_item_list ); - } - } - - // Merge item lists from top level collection with subcollection item lists - $collection_item_list = array_merge( $collection_item_list, $GLOBALS['zp_session'][$api_user_id]['collection_item_list'] ); - - // Remove items from tags, delete tags if no items - // This means that once imported, tags will remain if there's another item key, even if the item itself isn't imported - if ( count($collection_item_list) > 0 ) - { - foreach ( $collection_item_list as $item_key ) - { - // Get this item's tags - $item_tags = $wpdb->get_results( - " - SELECT tag_title FROM ".$wpdb->prefix."zotpress_zoteroRelItemTags - WHERE api_user_id='".$api_user_id."' AND item_key='".$item_key."' - " - ); - - if ( count($item_tags) > 0 ) - { - foreach ( $item_tags as $item_tag ) - { - // Delete relationship with item - $wpdb->query( - " - DELETE FROM ".$wpdb->prefix."zotpress_zoteroRelItemTags - WHERE api_user_id='".$api_user_id."' - AND (item_key = '".$item_key."' AND tag_title = '".$item_tag->tag_title."') - " - ); - - // Delete tags if they don't have items - $tag_itemrel_count = $wpdb->get_results( - " - SELECT COUNT(*) AS itemrel_count FROM ".$wpdb->prefix."zotpress_zoteroRelItemTags - WHERE api_user_id='".$api_user_id."' AND tag_title='".$item_tag->tag_title."' - " - ); - - if ( $tag_itemrel_count[0]->itemrel_count < 1) - { - $wpdb->query( - " - DELETE FROM ".$wpdb->prefix."zotpress_zoteroTags - WHERE api_user_id='".$api_user_id."' - AND title = '".$item_tag->tag_title."' - " - ); - } - - //$tag_items = str_replace( $item_key.",", "", $item_tag->listItems."," ); - // - //// Update tag's item list - //if ( strlen($tag_items) > 0 ) - //{ - // $wpdb->query( - // $wpdb->prepare( - // " - // UPDATE ".$wpdb->prefix."zotpress_zoteroTags - // SET listItems=%s - // WHERE id=%d - // ", - // rtrim( $tag_items, "," ), $item_tag->id - // ) - // ); - //} - //else // No items, so delete - //{ - // $wpdb->query( - // $wpdb->prepare( - // " - // DELETE FROM ".$wpdb->prefix."zotpress_zoteroTags WHERE id=%d - // ", - // $item_tag->id - // ) - // ); - //} - } - } - unset($item_tags); - } - unset($collection_item_list); - - /* - $all_tags = $wpdb->get_results( - " - SELECT id, title, listItems FROM ".$wpdb->prefix."zotpress_zoteroTags WHERE api_user_id='".$api_user_id."' - " - ); - - foreach ( $all_tags as $zp_tag ) - { - $zp_tag_items = explode( ',', $zp_tag->listItems ); - $updated_item_list = $zp_tag->listItems; - - // Create new item list for tag - foreach ( $zp_tag_items as $zp_tag_item ) { - if ( in_array( $zp_tag_item, $collection_item_list ) ) { - $updated_item_list = str_replace( $zp_tag_item.',', '', $updated_item_list ); - } - } - - if ( strlen($updated_item_list) > 0 ) - { - // Update tag's item list - $wpdb->query( - $wpdb->prepare( - " - UPDATE ".$wpdb->prefix."zotpress_zoteroTags - SET listItems=%s - WHERE id=%s - ", - rtrim( $updated_item_list, "," ), $zp_tag->id - ) - ); - } - else // No items left, so delete tag - { - $wpdb->query( - $wpdb->prepare( - " - DELETE FROM ".$wpdb->prefix."zotpress_zoteroTags WHERE id=%s - ", - $zp_tag->id - ) - ); - } - - unset($zp_tag_items); - unset($updated_item_list); - } - - unset($all_tags); - unset($collection_item_list); - unset($all_top_level_collections); - */ - } - - /* - if ( count($all_top_level_collections) > 0 ) - { - // Delete selected top level collection, items, subcollections and their items - foreach ( $all_top_level_collections as $top_level_collection ) - { - if ( in_array( $top_level_collection->description, $collections ) ) - { - // Get subcollections - $subcollections = get_terms( 'zp_collections', array( 'hide_empty' => true, 'child_of' => $top_level_collection->term_id ) ); - - if ( count($subcollections) > 0 ) - { - foreach ( $subcollections as $subcollection ) - { - // Get subcollection items - $subcollection_items = get_option( 'zp_collection-'.$subcollection->term_id.'-items' ); - if ( $subcollection_items !== false && strlen(trim($subcollection_items)) > 0 ) $collection_item_list .= trim($subcollection_items).','; // add to item list - unset($subcollection_items); - - // Delete subcollection - wp_delete_term( $subcollection->term_id, 'zp_collections' ); - } - } - unset($subcollections); - - // Get collection items - $collection_items = get_option( 'zp_collection-'.$top_level_collection->term_id.'-items' ); - if ( $collection_items !== false && strlen(trim($collection_items)) > 0 ) $collection_item_list .= trim($collection_items).','; // add to item list - unset($collection_items); - - // Delete collection - wp_delete_term( $top_level_collection->term_id, 'zp_collections' ); - } - } - - if ( trim($collection_item_list) != '' ) - { - $collection_item_list_arr = explode( ',', rtrim( $collection_item_list, ',' ) ); - $all_tags = get_terms( 'zp_tags', array( 'hide_empty' => false ) ); - - // Remove items and thier children - foreach ( $collection_item_list_arr as $c_item ) - { - // Get item's data - $c_item_data = get_posts( array( 'posts_per_page' => 1, 'post_type' => 'zp_entry', 'meta_key' => 'item_key', 'meta_value' => $c_item ) ); - - // Get item's children - $c_item_children = get_posts( array( 'posts_per_page' => -1, 'post_type' => 'zp_entry', 'meta_key' => 'parent', 'meta_value' => $c_item ) ); - - if ( count($c_item_children) > 0 ) - { - foreach ( $c_item_children as $c_item_child ) - { - $collection_item_list .= get_metadata( 'zp_entry', $c_item_child->ID, 'item_key' ).','; - wp_delete_post( $c_item_child->ID, true ); - } - unset($c_item_children); - } - foreach ( $c_item_data as $i ) wp_delete_post( $i->ID, true ); - unset($c_item_data); - } - unset($collection_item_list_arr); - - - // Remove items from tags, delete tags if no items - foreach ( $all_tags as $zp_tag ) - { - $zp_tag_items = explode( ',', $zp_tag->description ); - $updated_item_list = $zp_tag->description; - - // Create new item list for tag - foreach ( $zp_tag_items as $zp_tag_item ) if ( in_array( $zp_tag_item, $collection_item_list ) ) $updated_item_list = str_replace( $zp_tag_item.',', '', $updated_item_list ); - - if ( strlen($updated_item_list) > 0 ) - { - // Update tag's item list - wp_update_term( $zp_tag->term_id, 'zp_tags', array( 'description' => rtrim( $updated_item_list, ',' ) ) ); - } - else // No items left, so delete tag - { - wp_delete_term( $tag_to_delete->term_id, 'zp_tags' ); - } - - unset($zp_tag_items); - unset($updated_item_list); - } - unset($all_tags); - - } // collection items exist - } // top level collections exist - */ - } // collections to review exist - - break; - } - } - - - - /**************************************************************************************** - * - * ZOTPRESS IMPORT ITEMS - * - ****************************************************************************************/ - - function zp_get_items ($wpdb, $api_user_id, $zp_start, $zp_collection=false) - { - $zp_import_contents = new ZotpressRequest(); - $zp_account = zp_get_account($wpdb, $api_user_id); - - - // Get default style - $zp_default_style = "apa"; - if (get_option("Zotpress_DefaultStyle")) $zp_default_style = strtolower( get_option("Zotpress_DefaultStyle") ); - - // Build request URL - if ( $zp_collection ) $zp_collection_url = '/collections/'.$zp_collection; else $zp_collection_url = ''; - $zp_import_url = "https://api.zotero.org/".$zp_account[0]->account_type."/".$zp_account[0]->api_user_id.$zp_collection_url."/items?"; - if ( is_null($zp_account[0]->public_key) === false && trim($zp_account[0]->public_key) != "" ) - $zp_import_url .= "key=".$zp_account[0]->public_key."&"; - $zp_import_url .= "format=atom&content=json,bib&style=".$zp_default_style."&limit=50&start=".$zp_start; - - - // Make the request - $zp_xml = $zp_import_contents->get_request_contents( $zp_import_url, false ); - - // Stop in our tracks if there's a request error - if ($zp_import_contents->request_error) return $zp_import_contents->request_error; - - // Report any errors returned from Zotero - if ( trim(strtolower($zp_xml)) == "forbidden" ) - { - return "Zotero is telling Zotpress that access is forbidden. Are you sure that the Zotero API key you're using for this account is correct?"; - } - else if ( trim(strtolower($zp_xml)) == "invalid style" ) - { - return "Zotero is telling Zotpress that the style you're using is invalid. Are you sure that the name of the default style you've selected is correct?"; - } - - - // Make it DOM-traversable - $doc_citations = new DOMDocument(); - $doc_citations->loadXML($zp_xml); - - - // Get last set - if (!isset($GLOBALS['zp_session'][$api_user_id]['items']['last_set'])) - { - $last_set = ""; - $links = $doc_citations->getElementsByTagName("link"); - - foreach ($links as $link) - { - if ($link->getAttribute('rel') == "last") - { - if (stripos($link->getAttribute('href'), "start=") !== false) - { - $last_set = explode("start=", $link->getAttribute('href')); - $GLOBALS['zp_session'][$api_user_id]['items']['last_set'] = intval($last_set[1]); - } - else - { - $GLOBALS['zp_session'][$api_user_id]['items']['last_set'] = 0; - } - } - } - } - - - // PREPARE EACH ENTRY FOR DB INSERT - // Entries can be items or attachments (e.g. notes) - - $entries = $doc_citations->getElementsByTagName("entry"); - - foreach ($entries as $entry) - { - $item_key = $entry->getElementsByTagNameNS("http://zotero.org/ns/api", "key")->item(0)->nodeValue; - - //// For selective import: Keep track of and skip duplicates - //// Not working for some reason - ////if ( $zp_collection ) - ////{ - // if ( array_key_exists( $item_key, $GLOBALS['zp_session'][$api_user_id]['duplicates']['items'] ) ) - // continue; - // else - // $GLOBALS['zp_session'][$api_user_id]['duplicates']['items'][$item_key] = true; - ////} - - $retrieved = $entry->getElementsByTagName("updated")->item(0)->nodeValue; - $item_type = $entry->getElementsByTagNameNS("http://zotero.org/ns/api", "itemType")->item(0)->nodeValue; - - // Get citation content (json and bib) - - $citation_content = ""; - $citation_content_temp = new DOMDocument(); - - foreach($entry->getElementsByTagNameNS("http://zotero.org/ns/api", "subcontent") as $child) - { - if ($child->attributes->getNamedItem("type")->nodeValue == "json") - { - $json_content = $child->nodeValue; - } - else // Styled citation - { - foreach($child->childNodes as $child_content) { - $citation_content_temp->appendChild($citation_content_temp->importNode($child_content, true)); - $citation_content = $citation_content_temp->saveHTML(); - } - } - } - - // Get basic metadata from JSON - $json_content_decoded = json_decode($json_content); - - $author = ""; - $author_other = ""; - $date = ""; - $year = ""; - $title = ""; - $numchildren = 0; - $parent = ""; - $link_mode = ""; - - - if ( isset($json_content_decoded->creators) ) - { - if ( count($json_content_decoded->creators) > 0 ) - { - foreach ($json_content_decoded->creators as $creator) - if ($creator->creatorType == "author") - if (isset($creator->name)) // One-name authors - $author .= $creator->name . ", "; - else - $author .= $creator->lastName . ", "; - else - if (isset($creator->name)) // One-name authors - $author_other .= $creator->name . ", "; - else - $author_other .= $creator->lastName . ", "; - } - else // no creator - { - $author = ""; - //if (isset($creator->name)) // One-name authors - // $author .= $creator->creators["name"]; - //else - // $author .= $creator->creators["lastName"]; - } - } - else // no creator - { - $author = ""; - } - - // Determine if we use author or other author type - if (trim($author) == "") $author = $author_other; - - // Remove last comma - $author = preg_replace('~(.*)' . preg_quote(', ', '~') . '~', '$1' . '', $author, 1); - - $date = ""; if ( isset($json_content_decoded->date) ) $date = $json_content_decoded->date; - $year = zp_extract_year($date); - - if (trim($year) == "") $year = "0000"; - - $title = ""; if ( isset($json_content_decoded->title) ) $title = $json_content_decoded->title; - - $numchildren = 0; if ( isset($entry->getElementsByTagNameNS("http://zotero.org/ns/api", "numChildren")->item(0)->nodeValue) ) $numchildren = intval($entry->getElementsByTagNameNS("http://zotero.org/ns/api", "numChildren")->item(0)->nodeValue); - - // DOWNLOAD: Find URL - // for attachments, look at zapi:subcontent zapi:type="json" - linkMode - either imported_file or linked_url - if ($item_type == "attachment") - if (isset($json_content_decoded->linkMode)) $link_mode = $json_content_decoded->linkMode; - - // PARENT - //if ( $zp_collection ) // This was setting the parent of attachments to the collection - //{ - // $parent = $zp_collection; - //} - //else // Regular - //{ - foreach($entry->getElementsByTagName("link") as $entry_link) - { - if ($entry_link->getAttribute('rel') == "up") { - $temp = explode("items/", $entry_link->getAttribute('href')); - $temp = explode("?", $temp[1]); - $parent = $temp[0]; - } - - // Get download URL - if ($link_mode == "imported_file" && $entry_link->getAttribute('rel') == "self") { - $citation_content = substr($entry_link->getAttribute('href'), 0, strpos($entry_link->getAttribute('href'), "?")); - } - } - //} - - // Prep for insert into db - array_push($GLOBALS['zp_session'][$api_user_id]['items']['query_params'], - $zp_account[0]->api_user_id, - $item_key, - zp_db_prep($retrieved), - zp_db_prep($json_content), - zp_db_prep($author), - zp_db_prep($date), - zp_db_prep($year), - zp_db_prep($title), - $item_type, - $link_mode, - zp_db_prep($citation_content), - zp_db_prep($zp_default_style), - $numchildren, - $parent); - - $GLOBALS['zp_session'][$api_user_id]['items']['query_total_entries']++; - - } // foreach entry - - - // LAST SET - if ($GLOBALS['zp_session'][$api_user_id]['items']['last_set'] == $zp_start) - { - return false; - } - else // continue to next set of items - { - return true; - } - - unset($zp_import_contents); - unset($zp_import_url); - unset($zp_xml); - unset($doc_citations); - unset($entries); - - } // FUNCTION: zp_get_items - - - - function zp_save_items ($wpdb, $api_user_id, $not_done=false) - { - if ($GLOBALS['zp_session'][$api_user_id]['items']['query_total_entries'] > 0) - { - // Prepare query strings - $zp_relItemColl = ""; - $zp_relItemTags = ""; - - // Determine item-collection and item-tag relationships with JSON - for ( $i = 3; $i < count($GLOBALS['zp_session'][$api_user_id]['items']['query_params']); $i += 14 ) - { - $i_json = json_decode($GLOBALS['zp_session'][$api_user_id]['items']['query_params'][$i]); - - if ( isset($i_json->collections) && count($i_json->collections) > 0 ) - foreach ( $i_json->collections as $i_collection ) - $zp_relItemColl .= "('" . $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][$i-3] . "', '" . $i_json->itemKey . "', '" . htmlentities($i_collection, ENT_QUOTES ) . "'), "; - - if ( isset($i_json->tags) && count($i_json->tags) > 0 ) - foreach ( $i_json->tags as $i_tag ) - if ( trim($i_tag->tag) != "" ) - $zp_relItemTags .= "('" . $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][$i-3] . "', '" . $i_json->itemKey . "', '" . htmlentities(str_replace("&", "__and__", $i_tag->tag), ENT_QUOTES ) . "'), "; - } - - // Prepare string: remove extra comma and space OR set to blank if nothing to add - if ( strlen($zp_relItemColl) > 0 ) - { - $zp_relItemColl = "INSERT IGNORE INTO ".$wpdb->prefix."zotpress_zoteroRelItemColl - ( api_user_id, item_key, collection_key ) VALUES " . substr( $zp_relItemColl, 0, -2 ) . "; "; - } - - if ( strlen($zp_relItemTags) > 0 ) - { - $zp_relItemTags = "INSERT IGNORE INTO ".$wpdb->prefix."zotpress_zoteroRelItemTags - ( api_user_id, item_key, tag_title ) VALUES " . substr( $zp_relItemTags, 0, -2 ) . "; "; - } - - // Execute queries - if ( strlen($zp_relItemColl) > 0 ) $wpdb->query( $zp_relItemColl ); - if ( strlen($zp_relItemTags) > 0 ) $wpdb->query( $zp_relItemTags ); - $wpdb->query( - $wpdb->prepare( - " INSERT IGNORE INTO ".$wpdb->prefix."zotpress_zoteroItems - ( api_user_id, item_key, retrieved, json, author, zpdate, year, title, itemType, linkMode, citation, style, numchildren, parent ) - VALUES ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %s )" . str_repeat(", ( %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %s )", $GLOBALS['zp_session'][$api_user_id]['items']['query_total_entries']-1) .";", - $GLOBALS['zp_session'][$api_user_id]['items']['query_params'] - ) - ); - - $wpdb->flush(); - } - /*if ($GLOBALS['zp_session'][$api_user_id]['items']['query_total_entries'] > 0) - { - global $user_ID; - - for ($i = 0; $i <= ($GLOBALS['zp_session'][$api_user_id]['items']['query_total_entries'] - 1); $i++ ) - { - $mod = $i * 14; - - $post_id = wp_insert_post(array( - 'post_title' => $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][7+$mod], - 'post_content' => $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][10+$mod], - 'post_status' => 'publish', - 'post_date' => date('Y-m-d H:i:s'), - 'post_author' => $user_ID, - 'post_type' => 'zp_entry' - )); - - update_post_meta($post_id, 'api_user_id', $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][0+$mod]); - update_post_meta($post_id, 'item_key', $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][1+$mod]); - update_post_meta($post_id, 'retrieved', $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][2+$mod]); - update_post_meta($post_id, 'json_content', $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][3+$mod]); - update_post_meta($post_id, 'author', $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][4+$mod]); - update_post_meta($post_id, 'date', $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][5+$mod]); - update_post_meta($post_id, 'year', $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][6+$mod]); - update_post_meta($post_id, 'item_type', $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][8+$mod]); - update_post_meta($post_id, 'link_mode', $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][9+$mod]); - update_post_meta($post_id, 'style', $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][11+$mod]); - update_post_meta($post_id, 'numchildren', $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][12+$mod]); - update_post_meta($post_id, 'parent', $GLOBALS['zp_session'][$api_user_id]['items']['query_params'][13+$mod]); - } - }*/ - - if ($not_done) // reset everything - { - $GLOBALS['zp_session'][$api_user_id]['items']['query_params'] = array(); - $GLOBALS['zp_session'][$api_user_id]['items']['query_total_entries'] = 0; - } - else // unset everything - { - unset($GLOBALS['zp_session'][$api_user_id]['items']); - } - } - - - - /**************************************************************************************** - * - * ZOTPRESS IMPORT COLLECTIONS - * - ****************************************************************************************/ - - function zp_get_collections ($wpdb, $api_user_id, $zp_start, $toplevel=false, $zp_collection=false, $zp_single=false) - { - $zp_import_contents = new ZotpressRequest(); - $zp_account = zp_get_account($wpdb, $api_user_id); - $zp_collection_keys = ""; - - // Build request URL - if ( $toplevel === true ) $toplevel = '/top'; else $toplevel = ''; - if ( $zp_single ) $zp_single = '/'.$zp_single; else $zp_single = ''; - if ( $zp_collection ) $zp_collection = '/'.$zp_collection.'/collections'; else $zp_collection = ''; - - $zp_import_url = "https://api.zotero.org/".$zp_account[0]->account_type."/".$zp_account[0]->api_user_id."/collections".$toplevel.$zp_collection.$zp_single."?"; - if (is_null($zp_account[0]->public_key) === false && trim($zp_account[0]->public_key) != "") $zp_import_url .= "key=".$zp_account[0]->public_key."&"; - $zp_import_url .= "limit=50&start=".$zp_start; - - // Grab contents - $zp_xml = $zp_import_contents->get_request_contents( $zp_import_url, false ); - - // Report any errors returned from Zotero - if ( trim(strtolower($zp_xml)) == "forbidden" ) - { - return "Zotero is telling Zotpress that access is forbidden. Are you sure that the Zotero API key you're using for this account is correct?"; - } - - // Make it DOM-traversable - $doc_citations = new DOMDocument(); - $doc_citations->loadXML($zp_xml); - - - // Get last set - if (!isset($GLOBALS['zp_session'][$api_user_id]['collections']['last_set']) ) - { - $last_set = ""; - $links = $doc_citations->getElementsByTagName("link"); - - foreach ($links as $link) - { - if ($link->getAttribute('rel') == "last") - { - if (stripos($link->getAttribute('href'), "start=") !== false) - { - $last_set = explode("start=", $link->getAttribute('href')); - $GLOBALS['zp_session'][$api_user_id]['collections']['last_set'] = intval($last_set[1]); - } - else - { - $GLOBALS['zp_session'][$api_user_id]['collections']['last_set'] = 0; - } - } - } - } - - - - // GET COLLECTION META - - $entries = $doc_citations->getElementsByTagName("entry"); - - foreach ($entries as $entry) - { - $title = $entry->getElementsByTagName("title")->item(0)->nodeValue; - $retrieved = $entry->getElementsByTagName("updated")->item(0)->nodeValue; - $parent = ""; - - // Get parent collection - foreach($entry->getElementsByTagName("link") as $link) - { - if ($link->attributes->getNamedItem("rel")->nodeValue == "up") - { - $parent_temp = explode("/", $link->attributes->getNamedItem("href")->nodeValue); - $parent = $parent_temp[count($parent_temp)-1]; - } - } - - $item_key = $entry->getElementsByTagNameNS("http://zotero.org/ns/api", "key")->item(0)->nodeValue; - $numCollections = $entry->getElementsByTagNameNS("http://zotero.org/ns/api", "numCollections")->item(0)->nodeValue; - $numItems = $entry->getElementsByTagNameNS("http://zotero.org/ns/api", "numItems")->item(0)->nodeValue; - - unset($zp_import_contents); - unset($zp_import_url); - unset($zp_xml); - - - - // GET LIST OF ITEM KEYS - now dealt with in Items import -// $zp_import_contents = new ZotpressRequest(); -// -// // Build request URL -// $zp_import_url = "https://api.zotero.org/".$zp_account[0]->account_type."/".$zp_account[0]->api_user_id."/collections/".$item_key."/items?format=keys"; -// if (is_null($zp_account[0]->public_key) === false && trim($zp_account[0]->public_key) != "") $zp_import_url .= "&key=".$zp_account[0]->public_key; -// -// // Import item keys -// $zp_xml = $zp_import_contents->get_request_contents( $zp_import_url, false ); -// -// $zp_collection_itemkeys = rtrim(str_replace("\n", ",", $zp_xml), ","); -// -// unset($zp_import_contents); -// unset($zp_import_url); -// unset($zp_xml); - - - - // Prep for insert into db - array_push($GLOBALS['zp_session'][$api_user_id]['collections']['query_params'], - $zp_account[0]->api_user_id, - zp_db_prep($title), - zp_db_prep($retrieved), - zp_db_prep($parent), - $item_key, - $numCollections, - $numItems - ); - - $zp_collection_keys .= $item_key . ","; - - $GLOBALS['zp_session'][$api_user_id]['collections']['query_total_entries']++; - - unset($title); - unset($retrieved); - unset($parent); - unset($item_key); - unset($numCollections); - unset($numItems); - //unset($zp_collection_itemkeys); - - } // entry - - - // LAST SET - if ( - isset($GLOBALS['zp_session'][$api_user_id]['collections']['last_set']) - && $GLOBALS['zp_session'][$api_user_id]['collections']['last_set'] == $zp_start - ) - { - return array( "continue" => false, "collections" => rtrim( $zp_collection_keys, "," ) ); - } - else // continue to next set of collections - { - return array( "continue" => true, "collections" => rtrim( $zp_collection_keys, "," ) ); - } - - unset($doc_citations); - unset($entries); - - } // FUNCTION: zp_get_collections - - - - function zp_save_collections ($wpdb, $api_user_id, $not_done=false, $selective=false) - { - if ($GLOBALS['zp_session'][$api_user_id]['collections']['query_total_entries'] > 0) - { - $wpdb->query( $wpdb->prepare( - " - INSERT INTO ".$wpdb->prefix."zotpress_zoteroCollections - ( api_user_id, title, retrieved, parent, item_key, numCollections, numItems ) - VALUES ( %s, %s, %s, %s, %s, %d, %d )".str_repeat(", ( %s, %s, %s, %s, %s, %d, %d )", $GLOBALS['zp_session'][$api_user_id]['collections']['query_total_entries']-1), - $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'] - ) ); - - $wpdb->flush(); - } - /*if ($GLOBALS['zp_session'][$api_user_id]['collections']['query_total_entries'] > 0) - { - for ($i = 0; $i <= ($GLOBALS['zp_session'][$api_user_id]['collections']['query_total_entries'] - 1); $i++ ) - { - $mod = $i * 8; - - $collection_id = get_term_by( "name", $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][1+$mod], 'zp_collections', 'ARRAY_A' ); - if ( $collection_id === false ) $collection_id = wp_insert_term( $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][1+$mod], 'zp_collections', array( 'description' => $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][4+$mod] ) ); // description is collection key - - if ( get_option( 'zp_collection-'.$collection_id['term_id'].'-api_user_id' ) ) delete_option( 'zp_collection-'.$collection_id['term_id'].'-api_user_id' ); - add_option( 'zp_collection-'.$collection_id['term_id'].'-api_user_id', $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][0+$mod], '', false ); - - if ( get_option( 'zp_collection-'.$collection_id['term_id'].'-retrieved' ) ) delete_option( 'zp_collection-'.$collection_id['term_id'].'-retrieved' ); - add_option( 'zp_collection-'.$collection_id['term_id'].'-retrieved', $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][2+$mod], '', false ); - - if ( get_option( 'zp_collection-'.$collection_id['term_id'].'-parent' ) ) delete_option( 'zp_collection-'.$collection_id['term_id'].'-parent' ); - add_option( 'zp_collection-'.$collection_id['term_id'].'-parent', $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][3+$mod], '', false ); - - if ( get_option( 'zp_collection-'.$collection_id['term_id'].'-item_key' ) ) delete_option( 'zp_collection-'.$collection_id['term_id'].'-item_key' ); - add_option( 'zp_collection-'.$collection_id['term_id'].'-item_key', $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][4+$mod], '', false ); - - if ( get_option( 'zp_collection-'.$collection_id['term_id'].'-numCollections' ) ) delete_option( 'zp_collection-'.$collection_id['term_id'].'-numCollections' ); - add_option( 'zp_collection-'.$collection_id['term_id'].'-numCollections', $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][5+$mod], '', false ); - - if ( get_option( 'zp_collection-'.$collection_id['term_id'].'-numItems' ) ) delete_option( 'zp_collection-'.$collection_id['term_id'].'-numItems' ); - add_option( 'zp_collection-'.$collection_id['term_id'].'-numItems', $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][6+$mod], '', false ); - - if ( get_option( 'zp_collection-'.$collection_id['term_id'].'-items' ) ) delete_option( 'zp_collection-'.$collection_id['term_id'].'-items' ); - add_option( 'zp_collection-'.$collection_id['term_id'].'-items', $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][7+$mod], '', false ); - - // Link collections to entries - if ( trim($GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][7+$mod]) != "" ) - { - foreach ( explode(',', $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][7+$mod]) as $zp_entry ) - { - $zp_entry = get_posts( array( 'meta_key' => 'item_key', 'meta_value' => $zp_entry, 'post_type' => 'zp_entry' ) ); - wp_set_object_terms( $zp_entry[0]->ID, $collection_id['term_id'], 'zp_collections' ); - } - } - } - }*/ - - if (!$selective) - { - if ($not_done) // reset everything - { - $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'] = array(); - $GLOBALS['zp_session'][$api_user_id]['collections']['query_total_entries'] = 0; - } - else // unset everything - { - unset($GLOBALS['zp_session'][$api_user_id]['collections']); - } - } - } - - - - /*function zp_link_collections ($wpdb, $api_user_id) - { - delete_option('zp_collections_children'); - $collection_terms = get_terms( 'zp_collections', array( 'hide_empty' => false ) ); - - // Find parent, if exists - foreach ($collection_terms as $collection_term) - { - if ( strlen(trim(get_option( 'zp_collection-'.$collection_term->term_id.'-parent' ))) > 0 ) - { - foreach ($collection_terms as $collection_term_parent) - { - if ( get_option( 'zp_collection-'.$collection_term_parent->term_id.'-item_key' ) == - get_option( 'zp_collection-'.$collection_term->term_id.'-parent' ) ) - { - wp_update_term( $collection_term->term_id, 'zp_collections', - array( - 'parent' => $collection_term_parent->term_id - ) - ); - } - } - } - } - }*/ - - - - /**************************************************************************************** - * - * ZOTPRESS IMPORT TAGS - * - ****************************************************************************************/ - - function zp_get_tags ($wpdb, $api_user_id, $zp_start, $zp_collection=false) - { - $zp_import_contents = new ZotpressRequest(); - $zp_account = zp_get_account($wpdb, $api_user_id); - - // Get import url - if ( $zp_collection ) $zp_collection = '/collections/'.$zp_collection; else $zp_collection = ''; - - $zp_import_url = "https://api.zotero.org/".$zp_account[0]->account_type."/".$zp_account[0]->api_user_id.$zp_collection."/tags?limit=50&start=".$zp_start; - if (is_null($zp_account[0]->public_key) === false && trim($zp_account[0]->public_key) != "") - $zp_import_url .= "&key=".$zp_account[0]->public_key; - - // Import content - $zp_xml = $zp_import_contents->get_request_contents( $zp_import_url, false ); - - // Report any errors returned from Zotero - if ( trim(strtolower($zp_xml)) == "forbidden" ) - { - return "Zotero is telling Zotpress that access is forbidden. Are you sure that the Zotero API key you're using for this account is correct?"; - } - - // Make it DOM-traversable - $doc_citations = new DOMDocument(); - $doc_citations->loadXML($zp_xml); - - - // Get last set - if (!isset($GLOBALS['zp_session'][$api_user_id]['tags']['last_set'])) - { - $last_set = ""; - $links = $doc_citations->getElementsByTagName("link"); - - foreach ($links as $link) - { - if ($link->getAttribute('rel') == "last") - { - if (stripos($link->getAttribute('href'), "start=") !== false) - { - $last_set = explode("start=", $link->getAttribute('href')); - $GLOBALS['zp_session'][$api_user_id]['tags']['last_set'] = intval($last_set[1]); - } - else - { - $GLOBALS['zp_session'][$api_user_id]['tags']['last_set'] = 0; - } - } - } - } - - - // PREPARE EACH ENTRY FOR DB INSERT - - $entries = $doc_citations->getElementsByTagName("entry"); - - foreach ($entries as $entry) - { - $title = str_replace("&", "__and__", $entry->getElementsByTagName("title")->item(0)->nodeValue); - $retrieved = $entry->getElementsByTagName("updated")->item(0)->nodeValue; - $numItems = $entry->getElementsByTagNameNS("http://zotero.org/ns/api", "numItems")->item(0)->nodeValue; - - unset($zp_import_contents); - unset($zp_import_url); - unset($zp_xml); - - - // GET LIST OF ITEM KEYS - now handled in Items import -// $zp_import_contents = new ZotpressRequest(); -// -// $zp_import_url = "https://api.zotero.org/".$zp_account[0]->account_type."/".$zp_account[0]->api_user_id."/tags/".urlencode($title)."/items?format=keys"; -// if (is_null($zp_account[0]->public_key) === false && trim($zp_account[0]->public_key) != "") -// $zp_import_url .= "&key=".$zp_account[0]->public_key; -// -// // Import content -// $zp_xml = $zp_import_contents->get_request_contents( $zp_import_url, false ); -// -// $zp_tag_itemkeys = rtrim(str_replace("\n", ",", $zp_xml), ","); -// -// unset($zp_import_contents); -// unset($zp_import_url); -// unset($zp_xml); - - - // Prep for insert into db - array_push($GLOBALS['zp_session'][$api_user_id]['tags']['query_params'], - $zp_account[0]->api_user_id, - zp_db_prep($title), - zp_db_prep($retrieved), - $numItems - ); - - $GLOBALS['zp_session'][$api_user_id]['tags']['query_total_entries']++; - - unset($title); - unset($retrieved); - unset($numItems); - //unset($zp_tag_itemkeys); - - } // entry - - - // LAST SET - if ($GLOBALS['zp_session'][$api_user_id]['tags']['last_set'] == $zp_start) - { - return false; - } - else // continue to next set of collections - { - return true; - } - - unset($entries); - unset($doc_citations); - - } // FUNCTION: zp_get_tags - - - - function zp_save_tags ($wpdb, $api_user_id, $not_done=false) - { - if ($GLOBALS['zp_session'][$api_user_id]['tags']['query_total_entries'] > 0) - { - $wpdb->query( $wpdb->prepare( - " - INSERT INTO ".$wpdb->prefix."zotpress_zoteroTags - ( api_user_id, title, retrieved, numItems ) - VALUES ( %s, %s, %s, %d )".str_repeat(", ( %s, %s, %s, %d )", $GLOBALS['zp_session'][$api_user_id]['tags']['query_total_entries']-1) ." - ON DUPLICATE KEY UPDATE - api_user_id = VALUES(api_user_id), - title = VALUES(title), - retrieved = VALUES(retrieved), - numItems = VALUES(numItems) - ", - $GLOBALS['zp_session'][$api_user_id]['tags']['query_params'] - ) ); - - $wpdb->flush(); - } - /*if ($GLOBALS['zp_session'][$api_user_id]['tags']['query_total_entries'] > 0) - { - for ($i = 0; $i <= ($GLOBALS['zp_session'][$api_user_id]['tags']['query_total_entries'] - 1); $i++ ) - { - $mod = $i * 5; - - $tag_id = get_term_by( "name", $GLOBALS['zp_session'][$api_user_id]['tags']['query_params'][1+$mod], 'zp_tags', 'ARRAY_A' ); - if ( $tag_id === false ) $tag_id = wp_insert_term( $GLOBALS['zp_session'][$api_user_id]['tags']['query_params'][1+$mod], 'zp_tags', array( 'description' => $GLOBALS['zp_session'][$api_user_id]['collections']['query_params'][4+$mod] ) ); // description is list of items (note: different from collections, where description is collection key) - - if ( get_option( 'zp_tag-'.$tag_id['term_id'].'-api_user_id' ) ) delete_option( 'zp_tag-'.$tag_id['term_id'].'-api_user_id' ); - add_option( 'zp_tag-'.$tag_id['term_id'].'-api_user_id', $GLOBALS['zp_session'][$api_user_id]['tags']['query_params'][0+$mod], '', false ); - - if ( get_option( 'zp_tag-'.$tag_id['term_id'].'-retrieved' ) ) delete_option( 'zp_tag-'.$tag_id['term_id'].'-retrieved' ); - add_option( 'zp_tag-'.$tag_id['term_id'].'-retrieved', $GLOBALS['zp_session'][$api_user_id]['tags']['query_params'][2+$mod], '', false ); - - //if ( get_option( 'zp_tag-'.$tag_id['term_id'].'-numItems' ) ) delete_option( 'zp_tag-'.$tag_id['term_id'].'-numItems' ); - //add_option( 'zp_tag-'.$tag_id['term_id'].'-numItems', $GLOBALS['zp_session'][$api_user_id]['tags']['query_params'][3+$mod], '', false ); - - if ( get_option( 'zp_tag-'.$tag_id['term_id'].'-items' ) ) delete_option( 'zp_tag-'.$tag_id['term_id'].'-items' ); - add_option( 'zp_tag-'.$tag_id['term_id'].'-items', $GLOBALS['zp_session'][$api_user_id]['tags']['query_params'][4+$mod], '', false ); - - // Link tags to entries - if ( trim($GLOBALS['zp_session'][$api_user_id]['tags']['query_params'][4+$mod]) != "" ) - { - foreach ( explode(',', $GLOBALS['zp_session'][$api_user_id]['tags']['query_params'][4+$mod]) as $zp_entry ) - { - $zp_entry = get_posts( array( 'meta_key' => 'item_key', 'meta_value' => $zp_entry, 'post_type' => 'zp_entry' ) ); - wp_set_object_terms( $zp_entry[0]->ID, $tag_id['term_id'], 'zp_tags', true ); - } - } - } - }*/ - - if ($not_done) // reset everything - { - $GLOBALS['zp_session'][$api_user_id]['tags']['query_params'] = array(); - $GLOBALS['zp_session'][$api_user_id]['tags']['query_total_entries'] = 0; - } - else // unset everything - { - unset($GLOBALS['zp_session'][$api_user_id]['tags']); - } - } - - - -?> \ No newline at end of file diff --git a/lib/import/import.iframe.php b/lib/import/import.iframe.php deleted file mode 100644 index c6641ba..0000000 --- a/lib/import/import.iframe.php +++ /dev/null @@ -1,470 +0,0 @@ - 403 ) ); - - -/* -* IMPORT PSEUDOCODE: -* -* Get list of all item keys -* Import items in sets of 50 -* Import categories in sets of 50 -* Get list of all item keys for each tag -* Import tags in sets of 50 -* Get list of all item keys for each tag -* -* Requests to Zotero given 100 of each: -* 1 + 2 + 2 + 100 + 2 + 100 = 207 -* -*/ - -if ( isset($_GET['go']) && $_GET['go'] == "true" - && check_admin_referer( 'zp_importing_' . intval($_GET['api_user_id']) . '_' . date('Y-j-G'), 'zp_nonce' ) ) -{ - // Access WordPress db - global $wpdb; - - // Ignore user abort - ignore_user_abort(true); - set_time_limit(60*10); // ten minutes - - // Include Request Functionality - require( dirname(__FILE__) . '/../request/rss.request.php' ); - - // Include Import Functions - require( dirname(__FILE__) . '/import.functions.php' ); - - - ?> - - - - -- The importing process might take a few minutes, depending on what you choose to import and the size of your Zotero library. -
- -- You can selectively import top-level collections (which includes their items, subcollections, and subcollection items) below. You may need to wait a few moments if you have several top-level collections. -
- -There are no citations to display."; - if ( is_admin() ) echo " If you think you're receiving this message in error, you may need to getAccount()->api_user_id."\" style=\"color: #f00000; text-shadow: none;\">import your Zotero library."; - echo "
"; - } - else // display - { - foreach ($zp_citations as $entry) - { - $citation_id = $entry->item_key; - $citation_content = htmlentities( $entry->citation, ENT_QUOTES, "UTF-8", true ); - - $zp_thumbnail = false; - //if ( has_post_thumbnail( $entry->ID ) ) $zp_thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $entry->ID ) ); - if ( !is_null($entry->itemImage) ) $zp_thumbnail = wp_get_attachment_image_src($entry->itemImage); - - if ($entry_zebra === true) echo "Tags: "; - - foreach ($zp_showtags_results as $i => $zp_showtags_tag) - { - $citation_tags .= "" . $zp_showtags_tag["title"] . ""; - if ( $i != (count($zp_showtags_results)-1) ) $citation_tags .= ", "; - } - $citation_tags .= "
\n"; - } - unset($zp_showtags_results); - unset($zp_showtags_query); - } - - // ABSTRACT - if ($abstracts) - { - if (isset($zp_this_meta->abstractNote) && strlen(trim($zp_this_meta->abstractNote)) > 0) - { - $citation_abstract = "Abstract: " . sprintf($zp_this_meta->abstractNote) . "
\n"; - } - } - - // NOTES - if ($notes == "yes") - { - global $wpdb; - - $zp_notes = $wpdb->get_results("SELECT json FROM ".$wpdb->prefix."zotpress_zoteroItems WHERE api_user_id='".$zp_citation['userid']."' - AND parent = '".$zp_citation["item_key"]."' AND itemType = 'note';", OBJECT); - - if (count($zp_notes) > 0) - { - $temp_notes = "Sorry, but the selected Zotpress nickname can't be found.
"; return false; endif; + $api_user_id = $zp_account->api_user_id; + } elseif ($api_user_id !== false) { + $zp_account = eb_zotpress_get_account($api_user_id); + if ( is_null($zp_account) ): echo $api_user_id."Sorry, but the selected Zotpress account can't be found.
"; return false; endif; + $api_user_id = $zp_account->api_user_id; + } elseif ($api_user_id === false && $nickname === false) { + if (get_option("Zotpress_DefaultAccount") !== false) { - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress WHERE nickname='".$nickname."'", OBJECT); - - if ( is_null($zp_account) ): echo "Sorry, but the selected Zotpress nickname can't be found.
"; return false; endif; - - $api_user_id = $zp_account->api_user_id; + $api_user_id = get_option("Zotpress_DefaultAccount"); + $zp_account = eb_zotpress_get_account($api_user_id); } - else if ($api_user_id !== false) + else // When all else fails ... { - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress WHERE api_user_id='".$api_user_id."'", OBJECT); - - if ( is_null($zp_account) ): echo "Sorry, but the selected Zotpress account can't be found.
"; return false; endif; - + $zp_account = eb_zotpress_get_account(); $api_user_id = $zp_account->api_user_id; } - else if ($api_user_id === false && $nickname === false) - { - if (get_option("Zotpress_DefaultAccount") !== false) - { - $api_user_id = get_option("Zotpress_DefaultAccount"); - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress WHERE api_user_id ='".$api_user_id."'", OBJECT); - } - else // When all else fails ... - { - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress LIMIT 1", OBJECT); - $api_user_id = $zp_account->api_user_id; - } - } - - - // Use Browse class - - $zpLib = new zotpressBrowse; - - $zpLib->setAccount($zp_account); - $zpLib->setType($type); - if ( $searchby ) $zpLib->setFilters($searchby); - $zpLib->setMinLength($minlength); - $zpLib->setMaxResults($maxresults); - $zpLib->setMaxPerPage($maxperpage); - $zpLib->setCiteable($cite); - $zpLib->setDownloadable($download); - - $zpLib->getLib(); - } - - -?> \ No newline at end of file + } + + + // Use Browse class + + $zpLib = new zotpressLib; + + $zpLib->setAccount($zp_account); + $zpLib->setType($type); + if ( $searchby ) $zpLib->setFilters($searchby); + $zpLib->setMinLength($minlength); + $zpLib->setMaxResults($maxresults); + $zpLib->setMaxPerPage($maxperpage); + $zpLib->setMaxTags($maxtags); + $zpLib->setStyle($style); + $zpLib->setSortBy($sortby); + $zpLib->setOrder($order); + $zpLib->setCollection($collection_id); + $zpLib->setCiteable($cite); + $zpLib->setDownloadable($download); + $zpLib->setShowTags($showtags); + $zpLib->setShowImage($showimage); + $zpLib->setURLWrap($urlwrap); + $zpLib->setTopLevel($toplevel); + $zpLib->setTarget($target); + $zpLib->setBrowseBar($browsebar); + + // Show theme scripts + $GLOBALS['zp_is_shortcode_displayed'] = true; + + return $zpLib->getLib(); +} + + +?> diff --git a/lib/shortcode/shortcode.lib.search.php b/lib/shortcode/shortcode.lib.search.php deleted file mode 100644 index 693367c..0000000 --- a/lib/shortcode/shortcode.lib.search.php +++ /dev/null @@ -1,173 +0,0 @@ - 403 ) ); - - global $wpdb; - - header('Content-type: text/html; charset=utf-8'); - - - // Determine account - if ( isset($_GET['user']) && preg_match("/^[0-9]+$/", $_GET['user']) == 1 ) - { - $zp_api_user_id = $_GET['user']; - } - else // No user id passed through - { - if (get_option("Zotpress_DefaultAccount")) - { - $zp_api_user_id = get_option("Zotpress_DefaultAccount"); - } - else - { - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress LIMIT 1", OBJECT); - $zp_api_user_id = $zp_account->api_user_id; - } - } - - - // Determine filter, if any - $filter = "item"; if ( isset($_GET['filter']) && preg_match("/^[a-z]+$/", $_GET['filter']) == 1 ) $filter = $_GET['filter']; - - // Determine max results, if set - $limit = "100"; if ( isset($_GET['maxresults']) && preg_match("/^[0-9]+$/", $_GET['maxresults']) == 1 ) $limit = $_GET['maxresults']; - - - if ( $filter ) - { - if ( $filter == "item" ) - { - $tempquery = - " - SELECT DISTINCT ".$wpdb->prefix."zotpress_zoteroItems.author, - ".$wpdb->prefix."zotpress_zoteroItems.json, - ".$wpdb->prefix."zotpress_zoteroItems.citation AS item, - ".$wpdb->prefix."zotpress_zoteroItems.item_key - FROM ".$wpdb->prefix."zotpress_zoteroItems - - WHERE ".$wpdb->prefix."zotpress_zoteroItems.api_user_id='".$zp_api_user_id."' - AND ".$wpdb->prefix."zotpress_zoteroItems.itemType NOT IN ('attachment', 'note') - AND ".$wpdb->prefix."zotpress_zoteroItems.citation LIKE %s - - ORDER BY ".$wpdb->prefix."zotpress_zoteroItems.author ASC LIMIT ".$limit." - "; - - $zpSearchResults = $wpdb->get_results( - $wpdb->prepare( $tempquery, '%' . $wpdb->esc_like($_GET['term']) . '%' - ), OBJECT ); - } - elseif ( $filter == "collection" ) - { - // CONCAT( ".$wpdb->prefix."zotpress_zoteroCollections.title, ' (', ".$wpdb->prefix."zotpress_zoteroRelItemColl.collection_key, ')' ) AS item_key - $tempquery = - " - SELECT DISTINCT ".$wpdb->prefix."zotpress_zoteroItems.author, - ".$wpdb->prefix."zotpress_zoteroItems.json, - ".$wpdb->prefix."zotpress_zoteroItems.citation AS item, - ".$wpdb->prefix."zotpress_zoteroCollections.title AS item_key - FROM ".$wpdb->prefix."zotpress_zoteroRelItemColl - - LEFT JOIN ".$wpdb->prefix."zotpress_zoteroCollections - ON ".$wpdb->prefix."zotpress_zoteroRelItemColl.collection_key=".$wpdb->prefix."zotpress_zoteroCollections.item_key - - INNER JOIN ".$wpdb->prefix."zotpress_zoteroItems - ON ".$wpdb->prefix."zotpress_zoteroItems.item_key=".$wpdb->prefix."zotpress_zoteroRelItemColl.item_key - - WHERE ".$wpdb->prefix."zotpress_zoteroRelItemColl.api_user_id='".$zp_api_user_id."' - AND ".$wpdb->prefix."zotpress_zoteroRelItemColl.api_user_id=".$wpdb->prefix."zotpress_zoteroItems.api_user_id - AND ".$wpdb->prefix."zotpress_zoteroRelItemColl.api_user_id=".$wpdb->prefix."zotpress_zoteroCollections.api_user_id - AND ".$wpdb->prefix."zotpress_zoteroItems.itemType NOT IN ('attachment', 'note') - AND ".$wpdb->prefix."zotpress_zoteroCollections.title LIKE %s - - ORDER BY ".$wpdb->prefix."zotpress_zoteroItems.author ASC LIMIT ".$limit." - "; - - $zpSearchResults = $wpdb->get_results( - $wpdb->prepare( $tempquery, '%' . $wpdb->esc_like($_GET['term']) . '%' - ), OBJECT ); - } - elseif ( $filter == "tag" ) - { - $tempquery = - " - SELECT DISTINCT ".$wpdb->prefix."zotpress_zoteroItems.author, - ".$wpdb->prefix."zotpress_zoteroItems.json, - ".$wpdb->prefix."zotpress_zoteroItems.citation AS item, - ".$wpdb->prefix."zotpress_zoteroRelItemTags.tag_title AS item_key - FROM ".$wpdb->prefix."zotpress_zoteroItems - - INNER JOIN ".$wpdb->prefix."zotpress_zoteroRelItemTags - ON ".$wpdb->prefix."zotpress_zoteroItems.api_user_id=".$wpdb->prefix."zotpress_zoteroRelItemTags.api_user_id - AND ".$wpdb->prefix."zotpress_zoteroItems.item_key=".$wpdb->prefix."zotpress_zoteroRelItemTags.item_key - - WHERE ".$wpdb->prefix."zotpress_zoteroItems.api_user_id='".$zp_api_user_id."' - AND ".$wpdb->prefix."zotpress_zoteroItems.itemType NOT IN ('attachment', 'note') - AND ".$wpdb->prefix."zotpress_zoteroRelItemTags.tag_title LIKE %s - - ORDER BY ".$wpdb->prefix."zotpress_zoteroItems.author ASC LIMIT ".$limit." - "; - - $zpSearchResults = $wpdb->get_results( - $wpdb->prepare( $tempquery, '%' . $wpdb->esc_like($_GET['term']) . '%' - ), OBJECT ); - } - } - //else // ALL: How? Would be a really complex query - //{ - //} - - - // Format results for display - - $zpSearch = array(); - - if ( isset($zpSearchResults) && count($zpSearchResults) > 0 ) - { - foreach ( $zpSearchResults as $zpResult ) - { - // Deal with author - $author = $zpResult->author; - $zpResultJSON = json_decode( $zpResult->json ); - - if ( $author == "" ) - { - if ( isset($zpResultJSON->creators) && count($zpResultJSON->creators) > 0 ) - foreach ( $zpResultJSON->creators as $i => $creator ) - if ( $i != (count($zpResultJSON->creators)-1) ) - $author .= $creator->name . ', '; - else - $author .= $creator->name; - } - array_push( $zpSearch, array( "author" => $author, "item" => $zpResult->item, "item_key" => $zpResult->item_key, "url" => $zpResultJSON->url) ); - //array_push( $zpSearch, array( "author" => $author, "item" => $zpResult->item, "item_key" => $zpResult->item_key) ); - } - } - - echo json_encode($zpSearch); - - unset($zp_api_user_id); - unset($zp_account); - $wpdb->flush(); - -?> \ No newline at end of file diff --git a/lib/shortcode/shortcode.php b/lib/shortcode/shortcode.php index c9c9107..c18ed73 100644 --- a/lib/shortcode/shortcode.php +++ b/lib/shortcode/shortcode.php @@ -1,984 +1,453 @@ false, // deprecated + 'userid' => false, + 'nickname' => false, + 'nick' => false, + + 'author' => false, + 'authors' => false, + 'year' => false, + 'years' => false, + + 'itemtype' => false, // for selecting by itemtype; assumes one type + 'item_type' => 'items', + 'data_type' => false, // deprecated + 'datatype' => 'items', + + 'collection_id' => false, + 'collection' => false, + 'collections' => false, + + 'item_key' => false, + 'item' => false, + 'items' => false, + + 'inclusive' => 'yes', + + 'tag_name' => false, + 'tag' => false, + 'tags' => false, + + 'style' => false, + 'limit' => false, + + 'sortby' => 'default', + 'order' => false, + 'sort' => false, + + 'title' => 'no', + + 'image' => false, + 'images' => false, + 'showimage' => 'no', + + 'showtags' => 'no', + + 'downloadable' => 'no', + 'download' => 'no', + + 'shownotes' => false, + 'note' => false, + 'notes' => 'no', + + 'abstract' => false, + 'abstracts' => 'no', + + 'cite' => 'no', + 'citeable' => false, + + 'metadata' => false, + + 'target' => false, + 'urlwrap' => false, + + 'highlight' => false, + 'forcenumber' => false, + 'forcenumbers' => false + + ), $atts, 'zotpress')); + + + // +---------------------------+ + // | FORMAT & CLEAN PARAMETERS | + // +---------------------------+ + + // Filter by account + if ($user_id) { + $api_user_id = zp_clean_param( $user_id ); + } elseif ($userid) { + $api_user_id = zp_clean_param( $userid ); + } else $api_user_id = false; + + if ($nickname) $nickname = zp_clean_param( $nickname ); + if ($nick) $nickname = zp_clean_param( $nick ); + + // Filter by author + $author = zp_clean_param( $author ); + if ($authors) $author = zp_clean_param( $authors ); + + // Filter by year + if ($year) { + $year = zp_clean_param( $year ); + } elseif ($years) { + $year = zp_clean_param( $years ); + } elseif (strpos($year, ",") > 0) { + $year = explode(",", $year); + } else $year = ""; + + // Filter by itemtype + // TODO: Allow for a list of itemtypes in one shortcode? + $itemtype = zp_clean_param( $itemtype ); + if ( $itemtype !== false ) { - extract(shortcode_atts(array( - - 'user_id' => false, // deprecated - 'userid' => false, - 'nickname' => false, - 'nick' => false, - - 'author' => false, - 'authors' => false, - 'year' => false, - 'years' => false, - - 'data_type' => false, // deprecated - 'datatype' => "items", - - 'collection_id' => false, - 'collection' => false, - 'collections' => false, - - 'item_key' => false, - 'item' => false, - 'items' => false, - - 'inclusive' => "yes", - - 'tag_name' => false, - 'tag' => false, - 'tags' => false, - - 'content' => false, // deprecated - 'style' => false, - 'limit' => false, - - 'sortby' => "default", - 'order' => false, - 'sort' => false, - - 'title' => "no", - - 'image' => false, - 'images' => false, - 'showimage' => "no", - - 'showtags' => "no", - - 'downloadable' => "no", - 'download' => "no", - - 'note' => false, - 'notes' => "no", - - 'abstract' => false, - 'abstracts' => "no", - - 'cite' => "no", - 'citeable' => false, - - 'metadata' => false, - - 'link' => "no", - 'linkedlist' => "no", - - 'target' => false, - - 'forcenumber' => false, - - 'depth' => false - - ), $atts, "zotpress")); - - - // FORMAT PARAMETERS - - // Filter by account - if ($user_id) $api_user_id = str_replace('"','',html_entity_decode($user_id)); - else if ($userid) $api_user_id = str_replace('"','',html_entity_decode($userid)); - else $api_user_id = false; - - if ($nickname) $nickname = str_replace('"','',html_entity_decode($nickname)); - if ($nick) $nickname = str_replace('"','',html_entity_decode($nick)); - - // Filter by author - $author = str_replace('"','',html_entity_decode($author)); - if ($authors) $author = str_replace('"','',html_entity_decode($authors)); - - // Filter by year - $year = str_replace('"','',html_entity_decode($year)); - if ($years) $year = str_replace('"','',html_entity_decode($years)); - if (strpos($year, ",") > 0) $year = explode(",", $year); - - // Format with datatype and content - if ($data_type) $data_type = str_replace('"','',html_entity_decode($data_type)); - else $data_type = str_replace('"','',html_entity_decode($datatype)); - - // Filter by collection - if ($collection_id) $collection_id = str_replace('"','',html_entity_decode($collection_id)); - else if ($collection) $collection_id = str_replace('"','',html_entity_decode($collection)); - else if ($collections) $collection_id = str_replace('"','',html_entity_decode($collections)); - //else $collection_id = str_replace('"','',html_entity_decode($collection)); - - if (strpos($collection_id, ",") > 0) $collection_id = explode(",", $collection_id); - if ($data_type == "collections" && isset($_GET['zpcollection']) ) $collection_id = htmlentities( urldecode( $_GET['zpcollection'] ) ); - - // Filter by tag - if ($tag_name) $tag_name = str_replace('"','',html_entity_decode($tag_name)); - else if ($tags) $tag_name = str_replace('"','',html_entity_decode($tags)); - else $tag_name = str_replace('"','',html_entity_decode($tag)); - - $tag_name = str_replace("+", "", $tag_name); - if (strpos($tag_name, ",") > 0) $tag_name = explode(",", $tag_name); - if ($data_type == "tags" && isset($_GET['zptag']) ) $tag_name = htmlentities( urldecode( $_GET['zptag'] ) ); - - // Filter by itemkey - if ($item_key) $item_key = str_replace('"','',html_entity_decode($item_key)); - if ($items) $item_key = str_replace('"','',html_entity_decode($items)); - if ($item) $item_key = str_replace('"','',html_entity_decode($item)); - if (strpos($item_key, ",") > 0) $item_key = explode(",", $item_key); - - $content = str_replace('"','',html_entity_decode($content)); - $inclusive = str_replace('"','',html_entity_decode($inclusive)); - - // Format style - $style = str_replace('"','',html_entity_decode($style)); - - // Limit - $limit = str_replace('"','',html_entity_decode($limit)); - - // Order / sort - $sortby = str_replace('"','',html_entity_decode($sortby)); - - if ($order) $order = str_replace('"','',html_entity_decode($order)); - else if ($sort) $order = str_replace('"','',html_entity_decode($sort)); - if ($order === false) $order = "ASC"; - - // Show title - $title = str_replace('"','',html_entity_decode($title)); - if ($title == "yes" || $title == "true" || $title === true) - { - $title = true; - $sortby = "year"; - $order= "DESC"; - } - else { $title = false; } - - // Show image - if ($showimage) $showimage = str_replace('"','',html_entity_decode($showimage)); - if ($image) $showimage = str_replace('"','',html_entity_decode($image)); - if ($images) $showimage = str_replace('"','',html_entity_decode($images)); - - if ($showimage == "yes" || $showimage == "true" || $showimage === true) $showimage = true; - else $showimage = false; - - // Show tags - if ($showtags == "yes" || $showtags == "true" || $showtags === true) $showtags = true; - else $showtags = false; - - // Show download link - if ($download == "yes" || $download == "true" || $download === true - || $downloadable == "yes" || $downloadable == "true" || $downloadable === true) - $download = true; else $download = false; - - // Show notes - if ($notes) $notes = str_replace('"','',html_entity_decode($notes)); - else if ($note) $notes = str_replace('"','',html_entity_decode($note)); - - if ($notes == "yes" || $notes == "true" || $notes === true) $notes = true; - else $notes = false; - - // Show abstracts - if ($abstracts) $abstracts = str_replace('"','',html_entity_decode($abstracts)); - if ($abstract) $abstracts = str_replace('"','',html_entity_decode($abstract)); - - if ($abstracts == "yes" || $abstracts == "true" || $abstracts === true) $abstracts = true; - else $abstracts = false; - - // Show cite link - if ($cite) $cite = str_replace('"','',html_entity_decode($cite)); - if ($citeable) $cite = str_replace('"','',html_entity_decode($citeable)); - - if ($cite == "yes" || $cite == "true" || $cite === true) $cite = true; - else $cite = false; - - if ( !preg_match("/^[0-9a-zA-Z]+$/", $metadata) ) $metadata = false; - - if ( $link == "yes" || $link == "true" || $link === true ) $link = str_replace('"','',html_entity_decode($link)); - else if ( $linkedlist == "yes" || $linkedlist == "true" || $linkedlist === true ) $link = str_replace('"','',html_entity_decode($linkedlist)); - - if ($target == "yes" || $target == "_blank" || $target == "new" || $target == "true" || $target === true) - $target = true; else $target = false; - - if ($forcenumber == "yes" || $forcenumber == "true" || $forcenumber === true) + // Make sure it's one of the accepted types + $officialItemTypes = array( + 'book', + 'bookSection', + 'journalArticle', + 'conferencePaper', + 'thesis', + 'report', + 'encyclopediaArticle', + 'newspaperArticle', + 'magazineArticle', + 'presentation', + 'interview', + 'dictionaryEntry', + 'document', + 'manuscript', + 'patent', + 'map', + 'blogPost', + 'webpage', + 'artwork', + 'film', + 'audioRecording', + 'statute', + 'bill', + 'case', + 'hearing', + 'forumPost', + 'letter', + 'email', + 'instantMessage', + 'software', + 'podcast', + 'radioBroadcast', + 'tvBroadcast', + 'videoRecording', + 'attachment', + 'note' + ); + + $itemtypeCheck = false; + + foreach ($officialItemTypes as $type) + if ( $itemtype == $type ) $itemtypeCheck = true; + + if ( !$itemtypeCheck ) + $itemtype = false; // Default is no itemtype filter + } + + // Format with datatype and content + if ($item_type) { + $item_type = zp_clean_param( $item_type ); + } elseif ($data_type) { + $item_type = zp_clean_param( $data_type ); + } else $item_type = zp_clean_param( $datatype ); + + // Filter by collection + if ($collection_id) { + $collection_id = zp_clean_param( $collection_id ); + } elseif ($collection) { + $collection_id = zp_clean_param( $collection ); + } elseif ($collections) { + $collection_id = zp_clean_param( $collections ); + } + $collection_id = str_replace(" ", "", $collection_id ); + + if (strpos($collection_id, ",") > 0) $collection_id = explode(",", $collection_id); + if ($item_type == "collections" && isset($_GET['zpcollection']) ) $collection_id = htmlentities( urldecode( $_GET['zpcollection'] ) ); + + // Filter by tag + if ($tag_name) { + $tag_id = zp_clean_param( $tag_name ); + } elseif ($tags) { + $tag_id = zp_clean_param( $tags ); + } else $tag_id = zp_clean_param( $tag ); + + $tag_id = str_replace("+", "", $tag_id); + if (strpos($tag_id, ",") > 0) $tag_id = explode(",", $tag_id); + if ($item_type == "tags" && isset($_GET['zptag']) ) $tag_id = htmlentities( urldecode( $_GET['zptag'] ) ); + + // Filter by itemkey + if ($item_key) $item_key = zp_clean_param( $item_key ); + if ($items) $item_key = zp_clean_param( $items ); + if ($item) $item_key = zp_clean_param( $item ); + if (strpos($item_key, ", ") > 0) $item_key = str_replace(', ',',',html_entity_decode($item_key)); // remove spces after commas + // if (strpos($item_key, ",") > 0) $item_key = explode(",", $item_key); // ? break at commas? + $item_key = str_replace(" ", "", $item_key ); // remove any spaces + + // Inclusive (for multiple authors) + $inclusive = $inclusive == "yes" || $inclusive == "true" || $inclusive === true; + + // Format style + $style = zp_clean_param( $style ); + + // Limit + $limit = zp_clean_param( $limit ); + + // Order / sort + $sortby = zp_clean_param( $sortby ); + + if ($order) { + $order = strtolower(zp_clean_param( $order )); + } elseif ($sort) { + $order = strtolower(zp_clean_param( $sort )); + } + if ($order === false) $order = "asc"; + + // Show title + // Sorting by secondary sort + $title = zp_clean_param( $title ); + if ($title == "yes" || $title == "true" || $title === true) { + $title = "year"; + } elseif ($title == "no" || $title == "false") { + $title = false; + } + + // Show image + if ($showimage) $showimage = zp_clean_param( $showimage ); + if ($image) $showimage = zp_clean_param( $image ); + if ($images) $showimage = zp_clean_param( $images ); + + if ($showimage == "yes" || $showimage == "true" || $showimage === true) { + $showimage = true; + } elseif ($showimage === "openlib") { + $showimage = "openlib"; + } else $showimage = false; + + // Show tags + $showtags = $showtags == "yes" || $showtags == "true" || $showtags === true; + + // Show download link + if ($download == "yes" || $download == "true" || $download === true + || $downloadable == "yes" || $downloadable == "true" || $downloadable === true) + $downloadable = true; else $downloadable = false; + + // Show notes + if ($shownotes) { + $shownotes = zp_clean_param( $shownotes ); + } elseif ($notes) { + $shownotes = zp_clean_param( $notes ); + } elseif ($note) { + $shownotes = zp_clean_param( $note ); + } + + $shownotes = $notes == "yes" || $notes == "true" || $notes === true; + + // Show abstracts + if ($abstracts) $abstracts = zp_clean_param( $abstracts ); + if ($abstract) $abstracts = zp_clean_param( $abstract ); + + $abstracts = $abstracts == "yes" || $abstracts == "true" || $abstracts === true; + + // Show cite link + if ($cite) $citeable = zp_clean_param( $cite ); + if ($citeable) $citeable = zp_clean_param( $citeable ); + + $citeable = $citeable == "yes" || $citeable == "true" || $citeable === true; + + if ( ! preg_match("/^[0-9a-zA-Z]+$/", $metadata) ) $metadata = false; + + // URL attributes + if ($target == "yes" || $target == "_blank" || $target == "new" || $target == "true" || $target === true) + $target = true; else $target = false; + + $urlwrap = $urlwrap == "title" || $urlwrap == "image" ? zp_clean_param( $urlwrap ) : false; + + $highlight = $highlight ? zp_clean_param( $highlight ) : false; + + if ( $forcenumber == "yes" || $forcenumber == "true" || $forcenumber === true + || $forcenumbers == "yes" || $forcenumbers == "true" || $forcenumbers === true ) $forcenumber = true; else $forcenumber = false; - - if ($depth == "all" || $depth == "true" || $depth === true) - $depth = true; else $depth = false; - - - - // GET ACCOUNT - - global $wpdb; - - // Get account (api_user_id) - $zp_account = false; - - if ($nickname !== false) + + + // +-------------+ + // | GET ACCOUNT | + // +-------------+ + + global $wpdb; + + // Turn on/off minified versions if testing/live + $minify = ''; if ( ZOTPRESS_LIVEMODE ) $minify = '.min'; + + wp_enqueue_script( 'zotpress.shortcode.bib'.$minify.'.js' ); + + // Get account (api_user_id) + $zp_account = false; + + if ($nickname !== false) { + $zp_account = eb_zotpress_get_account( false, $nickname ); + if ( is_null($zp_account) ): + return "Sorry, but the selected Zotpress nickname can't be found.
"; + endif; + $api_user_id = $zp_account->api_user_id; + } elseif ($api_user_id !== false) { + $zp_account = eb_zotpress_get_account( $api_user_id ); + if ( is_null($zp_account) ): + return "Sorry, but the selected Zotpress account can't be found.
"; + endif; + $api_user_id = $zp_account->api_user_id; + } elseif ($api_user_id === false && $nickname === false) { + if (get_option("Zotpress_DefaultAccount") !== false) { - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress WHERE nickname='".$nickname."'", OBJECT); - - if ( is_null($zp_account) ): echo "Sorry, but the selected Zotpress nickname can't be found.
"; return false; endif; - - $api_user_id = $zp_account->api_user_id; + $api_user_id = get_option("Zotpress_DefaultAccount"); + $zp_account = eb_zotpress_get_account( $api_user_id ); } - else if ($api_user_id !== false) + else // When all else fails ... { - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress WHERE api_user_id='".$api_user_id."'", OBJECT); - - if ( is_null($zp_account) ): echo "Sorry, but the selected Zotpress account can't be found.
"; return false; endif; - + $zp_account = eb_zotpress_get_account(); $api_user_id = $zp_account->api_user_id; } - else if ($api_user_id === false && $nickname === false) - { - if (get_option("Zotpress_DefaultAccount") !== false) - { - $api_user_id = get_option("Zotpress_DefaultAccount"); - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress WHERE api_user_id ='".$api_user_id."'", OBJECT); - } - else // When all else fails ... - { - $zp_account = $wpdb->get_row("SELECT * FROM ".$wpdb->prefix."zotpress LIMIT 1", OBJECT); - $api_user_id = $zp_account->api_user_id; - } - } - - // Generate instance id for shortcode - $zp_instance_id = "zotpress-".md5($api_user_id.$nickname.$author.$year.$data_type.$collection_id.$item_key.$tag_name.$content.$style.$sortby.$order.$limit.$showimage.$download.$note.$cite); - - - - // GENERATE SHORTCODE - - if ($zp_account !== false) - { - - - // ITEMS - - if ( $data_type == "items" - || ($data_type == "tags" && isset($_GET['zptag']) ) - || ($data_type == "collections" && isset($_GET['zpcollection'])) ) - { - $zp_query = ""; - - if ($download) - { - $wpdb->get_results( - " - CREATE TEMPORARY TABLE attachments - SELECT * FROM - ( - SELECT - ".$wpdb->prefix."zotpress_zoteroItems.parent AS parent, - ".$wpdb->prefix."zotpress_zoteroItems.citation AS content, - ".$wpdb->prefix."zotpress_zoteroItems.item_key AS item_key, - ".$wpdb->prefix."zotpress_zoteroItems.json AS data, - ".$wpdb->prefix."zotpress_zoteroItems.linkmode AS linkmode - FROM ".$wpdb->prefix."zotpress_zoteroItems - WHERE api_user_id='".$api_user_id."' AND - ".$wpdb->prefix."zotpress_zoteroItems.linkmode IN ( 'imported_file', 'linked_url' ) - ORDER BY linkmode ASC - ) - AS attachments_sub - GROUP BY parent; - " - ); - } - - $zp_query .= "SELECT DISTINCT ".$wpdb->prefix."zotpress_zoteroItems.*"; - - if ($download) $zp_query .= ", attachments.content AS attachment_content, attachments.item_key AS attachment_key, attachments.data AS attachment_data, attachments.linkmode AS attachment_linkmode"; - - if ($showimage) $zp_query .= ", ".$wpdb->prefix."zotpress_zoteroItemImages.image AS itemImage"; - - $zp_query .= " FROM ".$wpdb->prefix."zotpress_zoteroItems "; - - - // JOINS: download, itemimage, collections, tags - - if ($download) - $zp_query .= " LEFT JOIN (attachments) ON (".$wpdb->prefix."zotpress_zoteroItems.item_key=attachments.parent) "; - - if ($showimage) - $zp_query .= " LEFT JOIN (".$wpdb->prefix."zotpress_zoteroItemImages) ON (".$wpdb->prefix."zotpress_zoteroItems.item_key=".$wpdb->prefix."zotpress_zoteroItemImages.item_key) "; - - if ($collection_id) - { - if ( is_array($collection_id) ) - { - // create inner joins - for ($i = 0; $i < count($collection_id); $i++) - $zp_query .= " INNER JOIN ".$wpdb->prefix."zotpress_zoteroRelItemColl AS zpRelItemColl".$i." ON ".$wpdb->prefix."zotpress_zoteroItems.item_key=zpRelItemColl".$i.".item_key "; - - // inclusive? - if ( $inclusive != "yes" ) - { - $zp_query .= " AND ( "; - - // exclusive to specific collections - for ($i = 0; $i < count($collection_id); $i++) - { - if ($i != 0) $zp_query .= " AND "; - $zp_query .= " zpRelItemColl".$i.".collection_key='".$collection_id[$i]."' "; - } - $zp_query .= " ) "; - } - } - else // single collection - { - $zp_query .= " LEFT JOIN ".$wpdb->prefix."zotpress_zoteroRelItemColl ON (".$wpdb->prefix."zotpress_zoteroItems.item_key=".$wpdb->prefix."zotpress_zoteroRelItemColl.item_key) "; - } -// if (!is_array($collection_id) -// || (is_array($collection_id) && $inclusive == "yes")) -// { -// $zp_query .= " LEFT JOIN ".$wpdb->prefix."zotpress_zoteroRelItemColl ON (".$wpdb->prefix."zotpress_zoteroItems.item_key=".$wpdb->prefix."zotpress_zoteroRelItemColl.item_key) "; -// } -// else if (is_array($collection_id) && $inclusive != "yes") -// { -// // create inner joins -// for ($i = 0; $i < count($collection_id); $i++) -// $zp_query .= " INNER JOIN ".$wpdb->prefix."zotpress_zoteroRelItemColl AS zpRelItemColl".$i." ON ".$wpdb->prefix."zotpress_zoteroItems.item_key=zpRelItemColl".$i.".item_key "; -// -// $zp_query .= " AND ( "; -// -// // exclusive to specific collections -// for ($i = 0; $i < count($collection_id); $i++) -// { -// if ($i != 0) $zp_query .= " AND "; -// $zp_query .= " zpRelItemColl".$i.".collection_key='".$collection_id[$i]."' "; -// } -// $zp_query .= " ) "; -// } - } - - if ($tag_name) - { - if (!is_array($tag_name) || (is_array($tag_name) && $inclusive == "yes")) - { - $zp_query .= " LEFT JOIN ".$wpdb->prefix."zotpress_zoteroRelItemTags ON (".$wpdb->prefix."zotpress_zoteroItems.item_key=".$wpdb->prefix."zotpress_zoteroRelItemTags.item_key) "; - } - else if (is_array($tag_name) && $inclusive != "yes") - { - // create inner joins - for ($i = 0; $i < count($tag_name); $i++) - $zp_query .= " INNER JOIN ".$wpdb->prefix."zotpress_zoteroRelItemTags AS zpRelItemTags".$i." ON ".$wpdb->prefix."zotpress_zoteroItems.item_key=zpRelItemTags".$i.".item_key "; - - $zp_query .= " AND ( "; - - // exclusive to specific tags - for ($i = 0; $i < count($tag_name); $i++) - { - if ($i != 0) $zp_query .= " AND "; - $zp_query .= " zpRelItemTags".$i.".tag_title='".str_replace("&", "__and__", $tag_name[$i])."' "; - } - $zp_query .= " ) "; - } - } - - // WHERE - - $zp_query .= " WHERE ".$wpdb->prefix."zotpress_zoteroItems.itemType != 'attachment' AND ".$wpdb->prefix."zotpress_zoteroItems.itemType != 'note' "; - - // Filter by collection(s) - if ($collection_id) - { - // Multiple inclusive collections - if (is_array($collection_id)) - { - if ($inclusive == "yes") - { - $zp_query .= " AND ("; - - foreach ($collection_id as $i => $id) - { - $zp_query .= "zpRelItemColl0.collection_key='".$id."' "; // for some reason, only need first reference to this table - - if ($i != count($collection_id)-1) $zp_query .= " OR "; - } - $zp_query .= ") "; - } - } - // Single collection - else - { - $zp_query .= " AND ".$wpdb->prefix."zotpress_zoteroRelItemColl.collection_key='".$collection_id."' "; - } - } // $collection_id - - // Filter by tag(s) - if ($tag_name) - { - // Multiple inclusive collections - if (is_array($tag_name)) - { - if ($inclusive == "yes") - { - $zp_query .= " AND ("; - - foreach ($tag_name as $i => $id) - { - $zp_query .= $wpdb->prefix."zotpress_zoteroRelItemTags.tag_title='".str_replace("&", "__and__", $id)."' "; - - if ($i != count($tag_name)-1) $zp_query .= " OR "; - } - $zp_query .= ") "; - } - } - // Single collection - else - { - $zp_query .= " AND ".$wpdb->prefix."zotpress_zoteroRelItemTags.tag_title='".str_replace("&", "__and__", $tag_name)."' "; - } - } // $tag_name - - // Filter by account - if ($api_user_id) - $zp_query .= " AND ".$wpdb->prefix."zotpress_zoteroItems.api_user_id='".$api_user_id."'"; - - // Filter by author - // Expects e.g. Name OR Name1,Name2 OR (NameLast,NameFirst) - // OR (Name1Last,Name1First),(Name1Last,Name1First) - if ($author) - { - $zp_query .= " AND ( "; - - $is_multiple_authors = false; - - // Deal with first and last name AND/OR multiple authors - if ( strpos($author, "(") > -1 ) - { - $author = str_replace("), (", "),(", $author); - - // If multiple authors and first name exists: - if ( strpos($author, "),(") > -1) - { - $author = explode("),(", $author); - - foreach ( $author as $id => $fullname ) - { - $author[$id] = explode(", ", str_replace("(", "", str_replace(")", "", $fullname))); - } - $is_multiple_authors = true; - } - else - { - // Just a single author - $author = array( explode(", ", str_replace("(", "", str_replace(")", "", $author))) ); - } - } - else if ( strpos($author, ",") > -1 ) - { - // Multiple last names - $author = explode(",", $author); - $is_multiple_authors = true; - } - - // Deal with multiple authors - if ($is_multiple_authors) - { - foreach ($author as $i => $zp_author) - { - // Prep author - if ( is_array($zp_author) ) $zp_author = $zp_author[0]; - $zp_author = strtolower(trim($zp_author)); - if (strpos($zp_author, " ") > 0) $zp_author = preg_split("/\s+(?=\S*+$)/", $zp_author); - - if (is_array($zp_author)) // full name (or multiple last names) - { - if ($inclusive == "yes" && $i != 0) $zp_query .= " OR "; else if ($inclusive != "yes" && $i != 0) $zp_query .= " AND "; - - $zp_query .= " FIND_IN_SET( '".$zp_author[1]."', REPLACE(".$wpdb->prefix."zotpress_zoteroItems.author, ', ', ',') )"; - $zp_query .= " OR FIND_IN_SET( '".implode(" ", $zp_author)."', REPLACE(".$wpdb->prefix."zotpress_zoteroItems.author, ', ', ',') )"; - } - else // last name only - { - if ($inclusive == "yes" && $i != 0) $zp_query .= " OR "; else if ($inclusive != "yes" && $i != 0) $zp_query .= " AND "; - - $zp_query .= " FIND_IN_SET( '".$zp_author."', REPLACE(".$wpdb->prefix."zotpress_zoteroItems.author, ', ', ',') )"; - } - } - } - else // Single author - { - // Prep author - if ( is_array($author) && is_array($author[0]) ) $zp_author = $author[0][0]; else $zp_author = $author; - $zp_author = strtolower(trim($zp_author)); - if ( strpos($zp_author, " ") > 0 ) $zp_author = preg_split("/\s+(?=\S*+$)/", $zp_author); - - // Full name in array (or multiple last names) - if (is_array($zp_author)) - { - $zp_query .= " FIND_IN_SET( '".$zp_author[1]."', REPLACE(".$wpdb->prefix."zotpress_zoteroItems.author, ', ', ',') )"; - $zp_query .= " OR FIND_IN_SET( '".implode(" ", $zp_author)."', REPLACE(".$wpdb->prefix."zotpress_zoteroItems.author, ', ', ',') )"; - } - // Last name only - else - { - $zp_query .= " FIND_IN_SET( '".$zp_author."', REPLACE(".$wpdb->prefix."zotpress_zoteroItems.author, ', ', ',') )"; - } - } - $zp_query .= " ) "; - } // $author - - // Filter by year: zpdate or year - if ($year) - { - if (is_array($year)) - { - $zp_query .= " AND FIND_IN_SET(".$wpdb->prefix."zotpress_zoteroItems.year, '".implode(",", $year)."')"; - } - else // single - { - $zp_query .= " AND ".$wpdb->prefix."zotpress_zoteroItems.year LIKE '%".$year."%'"; - } - } - - // Filter by item key - if ($item_key) - { - if (is_array($item_key)) - $zp_query .= " AND ".$wpdb->prefix."zotpress_zoteroItems.item_key IN('" . implode("','", $item_key) . "')"; - else // single - $zp_query .= " AND ".$wpdb->prefix."zotpress_zoteroItems.item_key='".$item_key."'"; - } - - // Sort by and sort direction - // Relies on db column and MySQL sorting - // Maybe sort by retrieved here, then do sorting after query execution? - if ($sortby) - { - if ($sortby == "default") - $sortby = "retrieved"; - else if ($sortby == "date") - $sortby = "year"; // zpdate -- MySQL doesn't understand - - if (($tag_name && $collection_id) || (is_array($year))) - $zp_query .= " ORDER BY ".$sortby." " . $order; - else - $zp_query .= " ORDER BY ".$wpdb->prefix."zotpress_zoteroItems.".$sortby." " . $order; - } - - // Limit - if ($limit) $zp_query .= " LIMIT ".$limit; - - - // Prep query -- still necessary? - - if ($item_key || $tag_name || $collection_id) - { - $zp_query = str_replace("AND AND", "AND", $zp_query); - } - else if ($author || $year) { - $zp_query = str_replace("OR ORDER BY", "ORDER BY", str_replace("OR AND", "OR", str_replace(" ", " ", $zp_query))); - } - - - - // GET ITEMS FROM DB - - //var_dump( $zp_query . "Tags: "; - - foreach ($zp_showtags_results as $i => $zp_showtags_tag) - { - $citation_tags .= "" . $zp_showtags_tag["title"] . ""; - if ( $i != (count($zp_showtags_results)-1) ) $citation_tags .= ", "; - } - $citation_tags .= "
\n"; - } - unset($zp_showtags_query); - unset($zp_showtags_results); - } - - // ABSTRACT - if ( $abstracts && isset($zp_this_meta->abstractNote) && strlen(trim($zp_this_meta->abstractNote)) > 0 ) - { - $citation_abstract = "Abstract: " . sprintf($zp_this_meta->abstractNote) . "
\n"; - } - - - // NOTES - if ($notes) - { - $zp_notes = $wpdb->get_results("SELECT json FROM ".$wpdb->prefix."zotpress_zoteroItems WHERE api_user_id='".$zp_citation['api_user_id']."' - AND parent = '".$zp_citation["item_key"]."' AND itemType = 'note';", OBJECT); - - if (count($zp_notes) > 0) - { - $temp_notes = "Sorry, there's no items to display.
\n"; - } - - $zp_output .= "\n\n"; - - } // end items - - - - // COLLECTIONS - - else if ($data_type == "collections" && !isset($_GET['zpcollection'])) - { - $zp_query = "SELECT ".$wpdb->prefix."zotpress_zoteroCollections.* FROM ".$wpdb->prefix."zotpress_zoteroCollections "; - $zp_query .= "WHERE api_user_id='".$api_user_id."' AND parent = '' "; - - // Sort by and sort direction - if ($sortby) - { - if ($sortby == "default") - $sortby = "retrieved"; - else if ($sortby == "date" || $sortby == "author") - continue; - - $zp_query .= " ORDER BY ".$sortby." " . $order; - } - - // Limit - if ($limit) $zp_query .= " LIMIT ".$limit; - - $zp_results = $wpdb->get_results($zp_query, OBJECT); unset($zp_query); - - - // DISPLAY CITATIONS - - $zp_output = "\nOptional. Single number or a range, e.g. 3-10.
-*Only required if you have more than one account.
-Optional. Be sure to replace spaces with a +.
- - - - - - -Optional. Default is "items."
- -Optional. Default is "bib."
- -Optional. Displays title by year.
- -Optional. Displays image if exists.
- -Optional. Default is "."
- - -Optional. Default is "latest."
- -Optional. Default is "desc."
- -Optional. Displays download link.
- -Optional. Displays note/s if they exist.
- -Copy-n-paste at the end of your post.
- -Add more styles here. Note: Requires re-import.
- -Use these placeholders: %a% for author, %d% for date, %p% for page, %num% for list number.
- -Add more styles here. Note: Requires re-import.
- -- - -
- - - -
-
-
- - -
- -- - -
- -- - -
- -- - -
- -- - -
- -- - -
- -
-
-
-
-
- - -
- -
-
-
-
-
-
-
-
-
-
-
-
-
+ + +
+ + + +
+
+
+ + +
+ ++ + +
+ ++ + +
+ ++ + +
+ ++ + +
+ ++ + +
+ +
+
+
+
+
+ + +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
Styles listed here. Examples: apa, chicago-author-date, nature, modern-language-association.
- -Use these placeholders: %a% for author, %d% for date, %p% for page, %num% for list number.
- - -Styles listed here. Examples: apa, chicago-author-date, nature, modern-language-association.
- -'; - printf(__('URGENT: Due to major changes in Zotpress, your Zotero account(s) need to be re-imported. | Hide Notice'), 'admin.php?page=Zotpress&zotpress_5_2_ignore=0'); - echo "