Version Description
Download this release
Release Info
Developer | qqworld |
Plugin | QQWorld Auto Save Images |
Version | 1.5.2 |
Comparing to | |
See all releases |
Code changes from version 1.4.3 to 1.5.2
- css/style.css +40 -0
- js/jquery.noty.packaged.min.js +10 -0
- lang/qqworld_auto_save_images-zh_CN.mo +0 -0
- lang/qqworld_auto_save_images-zh_CN.po +38 -1
- qqworld-auto-save-images.php +186 -38
css/style.css
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#banner {
|
2 |
+
max-width: 100%;
|
3 |
+
height: auto;
|
4 |
+
display: block;
|
5 |
+
margin: 20px 0;
|
6 |
+
border: 10px solid #fff;
|
7 |
+
box-sizing: border-box;
|
8 |
+
box-shadow: 3px 3px 3px rgba(0,0,0,.1);
|
9 |
+
}
|
10 |
+
|
11 |
+
#scan_old_post_list {
|
12 |
+
border-collapse: collapse;
|
13 |
+
width: 100%;
|
14 |
+
border: 1px solid #e4e4e4;
|
15 |
+
border-bottom: 3px solid #e4e4e4;
|
16 |
+
text-align: left;
|
17 |
+
background: #fff;
|
18 |
+
}
|
19 |
+
#scan_old_post_list tbody tr:nth-child(odd) {
|
20 |
+
background: #fafafa;
|
21 |
+
}
|
22 |
+
#scan_old_post_list tbody tr:hover {
|
23 |
+
background: #fcfcb7;
|
24 |
+
}
|
25 |
+
#scan_old_post_list thead tr {
|
26 |
+
background: #2ea2cc;
|
27 |
+
border-bottom: 2px solid #0074a2;
|
28 |
+
color: #fff;
|
29 |
+
}
|
30 |
+
#scan_old_post_list td, #scan_old_post_list th {
|
31 |
+
padding: 5px 20px;
|
32 |
+
border-bottom: 1px solid #e4e4e4;
|
33 |
+
}
|
34 |
+
|
35 |
+
#post_types_list {
|
36 |
+
padding-bottom: 10px;
|
37 |
+
}
|
38 |
+
#post_types_list label {
|
39 |
+
margin-right: 15px;
|
40 |
+
}
|
js/jquery.noty.packaged.min.js
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
@package noty - jQuery Notification Plugin
|
3 |
+
@version version: 2.2.5
|
4 |
+
@contributors https://github.com/needim/noty/graphs/contributors
|
5 |
+
|
6 |
+
@documentation Examples and Documentation - http://needim.github.com/noty/
|
7 |
+
|
8 |
+
@license Licensed under the MIT licenses: http://www.opensource.org/licenses/mit-license.php
|
9 |
+
*/
|
10 |
+
"function"!=typeof Object.create&&(Object.create=function(a){function b(){}return b.prototype=a,new b}),function(a){var b={init:function(b){return this.options=a.extend({},a.noty.defaults,b),this.options.layout=this.options.custom?a.noty.layouts.inline:a.noty.layouts[this.options.layout],a.noty.themes[this.options.theme]?this.options.theme=a.noty.themes[this.options.theme]:b.themeClassName=this.options.theme,delete b.layout,delete b.theme,this.options=a.extend({},this.options,this.options.layout.options),this.options.id="noty_"+(new Date).getTime()*Math.floor(1e6*Math.random()),this.options=a.extend({},this.options,b),this._build(),this},_build:function(){var b=a('<div class="noty_bar noty_type_'+this.options.type+'"></div>').attr("id",this.options.id);if(b.append(this.options.template).find(".noty_text").html(this.options.text),this.$bar=null!==this.options.layout.parent.object?a(this.options.layout.parent.object).css(this.options.layout.parent.css).append(b):b,this.options.themeClassName&&this.$bar.addClass(this.options.themeClassName).addClass("noty_container_type_"+this.options.type),this.options.buttons){this.options.closeWith=[],this.options.timeout=!1;var c=a("<div/>").addClass("noty_buttons");null!==this.options.layout.parent.object?this.$bar.find(".noty_bar").append(c):this.$bar.append(c);var d=this;a.each(this.options.buttons,function(b,c){var e=a("<button/>").addClass(c.addClass?c.addClass:"gray").html(c.text).attr("id",c.id?c.id:"button-"+b).appendTo(d.$bar.find(".noty_buttons")).on("click",function(){a.isFunction(c.onClick)&&c.onClick.call(e,d)})})}this.$message=this.$bar.find(".noty_message"),this.$closeButton=this.$bar.find(".noty_close"),this.$buttons=this.$bar.find(".noty_buttons"),a.noty.store[this.options.id]=this},show:function(){var b=this;return b.options.custom?b.options.custom.find(b.options.layout.container.selector).append(b.$bar):a(b.options.layout.container.selector).append(b.$bar),b.options.theme&&b.options.theme.style&&b.options.theme.style.apply(b),"function"===a.type(b.options.layout.css)?this.options.layout.css.apply(b.$bar):b.$bar.css(this.options.layout.css||{}),b.$bar.addClass(b.options.layout.addClass),b.options.layout.container.style.apply(a(b.options.layout.container.selector)),b.showing=!0,b.options.theme&&b.options.theme.style&&b.options.theme.callback.onShow.apply(this),a.inArray("click",b.options.closeWith)>-1&&b.$bar.css("cursor","pointer").one("click",function(a){b.stopPropagation(a),b.options.callback.onCloseClick&&b.options.callback.onCloseClick.apply(b),b.close()}),a.inArray("hover",b.options.closeWith)>-1&&b.$bar.one("mouseenter",function(){b.close()}),a.inArray("button",b.options.closeWith)>-1&&b.$closeButton.one("click",function(a){b.stopPropagation(a),b.close()}),-1==a.inArray("button",b.options.closeWith)&&b.$closeButton.remove(),b.options.callback.onShow&&b.options.callback.onShow.apply(b),b.$bar.animate(b.options.animation.open,b.options.animation.speed,b.options.animation.easing,function(){b.options.callback.afterShow&&b.options.callback.afterShow.apply(b),b.showing=!1,b.shown=!0}),b.options.timeout&&b.$bar.delay(b.options.timeout).promise().done(function(){b.close()}),this},close:function(){if(!(this.closed||this.$bar&&this.$bar.hasClass("i-am-closing-now"))){var b=this;if(this.showing)return b.$bar.queue(function(){b.close.apply(b)}),void 0;if(!this.shown&&!this.showing){var c=[];return a.each(a.noty.queue,function(a,d){d.options.id!=b.options.id&&c.push(d)}),a.noty.queue=c,void 0}b.$bar.addClass("i-am-closing-now"),b.options.callback.onClose&&b.options.callback.onClose.apply(b),b.$bar.clearQueue().stop().animate(b.options.animation.close,b.options.animation.speed,b.options.animation.easing,function(){b.options.callback.afterClose&&b.options.callback.afterClose.apply(b)}).promise().done(function(){b.options.modal&&(a.notyRenderer.setModalCount(-1),0==a.notyRenderer.getModalCount()&&a(".noty_modal").fadeOut("fast",function(){a(this).remove()})),a.notyRenderer.setLayoutCountFor(b,-1),0==a.notyRenderer.getLayoutCountFor(b)&&a(b.options.layout.container.selector).remove(),"undefined"!=typeof b.$bar&&null!==b.$bar&&(b.$bar.remove(),b.$bar=null,b.closed=!0),delete a.noty.store[b.options.id],b.options.theme.callback&&b.options.theme.callback.onClose&&b.options.theme.callback.onClose.apply(b),b.options.dismissQueue||(a.noty.ontap=!0,a.notyRenderer.render()),b.options.maxVisible>0&&b.options.dismissQueue&&a.notyRenderer.render()})}},setText:function(a){return this.closed||(this.options.text=a,this.$bar.find(".noty_text").html(a)),this},setType:function(a){return this.closed||(this.options.type=a,this.options.theme.style.apply(this),this.options.theme.callback.onShow.apply(this)),this},setTimeout:function(a){if(!this.closed){var b=this;this.options.timeout=a,b.$bar.delay(b.options.timeout).promise().done(function(){b.close()})}return this},stopPropagation:function(a){a=a||window.event,"undefined"!=typeof a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},closed:!1,showing:!1,shown:!1};a.notyRenderer={},a.notyRenderer.init=function(c){var d=Object.create(b).init(c);return d.options.killer&&a.noty.closeAll(),d.options.force?a.noty.queue.unshift(d):a.noty.queue.push(d),a.notyRenderer.render(),"object"==a.noty.returns?d:d.options.id},a.notyRenderer.render=function(){var b=a.noty.queue[0];"object"===a.type(b)?b.options.dismissQueue?b.options.maxVisible>0?a(b.options.layout.container.selector+" li").length<b.options.maxVisible&&a.notyRenderer.show(a.noty.queue.shift()):a.notyRenderer.show(a.noty.queue.shift()):a.noty.ontap&&(a.notyRenderer.show(a.noty.queue.shift()),a.noty.ontap=!1):a.noty.ontap=!0},a.notyRenderer.show=function(b){b.options.modal&&(a.notyRenderer.createModalFor(b),a.notyRenderer.setModalCount(1)),b.options.custom?0==b.options.custom.find(b.options.layout.container.selector).length?b.options.custom.append(a(b.options.layout.container.object).addClass("i-am-new")):b.options.custom.find(b.options.layout.container.selector).removeClass("i-am-new"):0==a(b.options.layout.container.selector).length?a("body").append(a(b.options.layout.container.object).addClass("i-am-new")):a(b.options.layout.container.selector).removeClass("i-am-new"),a.notyRenderer.setLayoutCountFor(b,1),b.show()},a.notyRenderer.createModalFor=function(b){if(0==a(".noty_modal").length){var c=a("<div/>").addClass("noty_modal").addClass(b.options.theme).data("noty_modal_count",0);b.options.theme.modal&&b.options.theme.modal.css&&c.css(b.options.theme.modal.css),c.prependTo(a("body")).fadeIn("fast")}},a.notyRenderer.getLayoutCountFor=function(b){return a(b.options.layout.container.selector).data("noty_layout_count")||0},a.notyRenderer.setLayoutCountFor=function(b,c){return a(b.options.layout.container.selector).data("noty_layout_count",a.notyRenderer.getLayoutCountFor(b)+c)},a.notyRenderer.getModalCount=function(){return a(".noty_modal").data("noty_modal_count")||0},a.notyRenderer.setModalCount=function(b){return a(".noty_modal").data("noty_modal_count",a.notyRenderer.getModalCount()+b)},a.fn.noty=function(b){return b.custom=a(this),a.notyRenderer.init(b)},a.noty={},a.noty.queue=[],a.noty.ontap=!0,a.noty.layouts={},a.noty.themes={},a.noty.returns="object",a.noty.store={},a.noty.get=function(b){return a.noty.store.hasOwnProperty(b)?a.noty.store[b]:!1},a.noty.close=function(b){return a.noty.get(b)?a.noty.get(b).close():!1},a.noty.setText=function(b,c){return a.noty.get(b)?a.noty.get(b).setText(c):!1},a.noty.setType=function(b,c){return a.noty.get(b)?a.noty.get(b).setType(c):!1},a.noty.clearQueue=function(){a.noty.queue=[]},a.noty.closeAll=function(){a.noty.clearQueue(),a.each(a.noty.store,function(a,b){b.close()})};var c=window.alert;a.noty.consumeAlert=function(b){window.alert=function(c){b?b.text=c:b={text:c},a.notyRenderer.init(b)}},a.noty.stopConsumeAlert=function(){window.alert=c},a.noty.defaults={layout:"top",theme:"defaultTheme",type:"alert",text:"",dismissQueue:!0,template:'<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',animation:{open:{height:"toggle"},close:{height:"toggle"},easing:"swing",speed:500},timeout:!1,force:!1,modal:!1,maxVisible:5,killer:!1,closeWith:["click"],callback:{onShow:function(){},afterShow:function(){},onClose:function(){},afterClose:function(){},onCloseClick:function(){}},buttons:!1},a(window).on("resize",function(){a.each(a.noty.layouts,function(b,c){c.container.style.apply(a(c.container.selector))})})}(jQuery),window.noty=function(a){return jQuery.notyRenderer.init(a)},function(a){a.noty.layouts.bottom={name:"bottom",options:{},container:{object:'<ul id="noty_bottom_layout_container" />',selector:"ul#noty_bottom_layout_container",style:function(){a(this).css({bottom:0,left:"5%",position:"fixed",width:"90%",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:9999999})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none"},addClass:""}}(jQuery),function(a){a.noty.layouts.bottomCenter={name:"bottomCenter",options:{},container:{object:'<ul id="noty_bottomCenter_layout_container" />',selector:"ul#noty_bottomCenter_layout_container",style:function(){a(this).css({bottom:20,left:0,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),a(this).css({left:(a(window).width()-a(this).outerWidth(!1))/2+"px"})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.bottomLeft={name:"bottomLeft",options:{},container:{object:'<ul id="noty_bottomLeft_layout_container" />',selector:"ul#noty_bottomLeft_layout_container",style:function(){a(this).css({bottom:20,left:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),window.innerWidth<600&&a(this).css({left:5})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.bottomRight={name:"bottomRight",options:{},container:{object:'<ul id="noty_bottomRight_layout_container" />',selector:"ul#noty_bottomRight_layout_container",style:function(){a(this).css({bottom:20,right:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),window.innerWidth<600&&a(this).css({right:5})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.center={name:"center",options:{},container:{object:'<ul id="noty_center_layout_container" />',selector:"ul#noty_center_layout_container",style:function(){a(this).css({position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7});var b=a(this).clone().css({visibility:"hidden",display:"block",position:"absolute",top:0,left:0}).attr("id","dupe");a("body").append(b),b.find(".i-am-closing-now").remove(),b.find("li").css("display","block");var c=b.height();b.remove(),a(this).hasClass("i-am-new")?a(this).css({left:(a(window).width()-a(this).outerWidth(!1))/2+"px",top:(a(window).height()-c)/2+"px"}):a(this).animate({left:(a(window).width()-a(this).outerWidth(!1))/2+"px",top:(a(window).height()-c)/2+"px"},500)}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.centerLeft={name:"centerLeft",options:{},container:{object:'<ul id="noty_centerLeft_layout_container" />',selector:"ul#noty_centerLeft_layout_container",style:function(){a(this).css({left:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7});var b=a(this).clone().css({visibility:"hidden",display:"block",position:"absolute",top:0,left:0}).attr("id","dupe");a("body").append(b),b.find(".i-am-closing-now").remove(),b.find("li").css("display","block");var c=b.height();b.remove(),a(this).hasClass("i-am-new")?a(this).css({top:(a(window).height()-c)/2+"px"}):a(this).animate({top:(a(window).height()-c)/2+"px"},500),window.innerWidth<600&&a(this).css({left:5})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.centerRight={name:"centerRight",options:{},container:{object:'<ul id="noty_centerRight_layout_container" />',selector:"ul#noty_centerRight_layout_container",style:function(){a(this).css({right:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7});var b=a(this).clone().css({visibility:"hidden",display:"block",position:"absolute",top:0,left:0}).attr("id","dupe");a("body").append(b),b.find(".i-am-closing-now").remove(),b.find("li").css("display","block");var c=b.height();b.remove(),a(this).hasClass("i-am-new")?a(this).css({top:(a(window).height()-c)/2+"px"}):a(this).animate({top:(a(window).height()-c)/2+"px"},500),window.innerWidth<600&&a(this).css({right:5})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.inline={name:"inline",options:{},container:{object:'<ul class="noty_inline_layout_container" />',selector:"ul.noty_inline_layout_container",style:function(){a(this).css({width:"100%",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:9999999})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none"},addClass:""}}(jQuery),function(a){a.noty.layouts.top={name:"top",options:{},container:{object:'<ul id="noty_top_layout_container" />',selector:"ul#noty_top_layout_container",style:function(){a(this).css({top:0,left:"5%",position:"fixed",width:"90%",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:9999999})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none"},addClass:""}}(jQuery),function(a){a.noty.layouts.topCenter={name:"topCenter",options:{},container:{object:'<ul id="noty_topCenter_layout_container" />',selector:"ul#noty_topCenter_layout_container",style:function(){a(this).css({top:20,left:0,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),a(this).css({left:(a(window).width()-a(this).outerWidth(!1))/2+"px"})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.topLeft={name:"topLeft",options:{},container:{object:'<ul id="noty_topLeft_layout_container" />',selector:"ul#noty_topLeft_layout_container",style:function(){a(this).css({top:20,left:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),window.innerWidth<600&&a(this).css({left:5})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.layouts.topRight={name:"topRight",options:{},container:{object:'<ul id="noty_topRight_layout_container" />',selector:"ul#noty_topRight_layout_container",style:function(){a(this).css({top:20,right:20,position:"fixed",width:"310px",height:"auto",margin:0,padding:0,listStyleType:"none",zIndex:1e7}),window.innerWidth<600&&a(this).css({right:5})}},parent:{object:"<li />",selector:"li",css:{}},css:{display:"none",width:"310px"},addClass:""}}(jQuery),function(a){a.noty.themes.defaultTheme={name:"defaultTheme",helpers:{borderFix:function(){if(this.options.dismissQueue){var b=this.options.layout.container.selector+" "+this.options.layout.parent.selector;switch(this.options.layout.name){case"top":a(b).css({borderRadius:"0px 0px 0px 0px"}),a(b).last().css({borderRadius:"0px 0px 5px 5px"});break;case"topCenter":case"topLeft":case"topRight":case"bottomCenter":case"bottomLeft":case"bottomRight":case"center":case"centerLeft":case"centerRight":case"inline":a(b).css({borderRadius:"0px 0px 0px 0px"}),a(b).first().css({"border-top-left-radius":"5px","border-top-right-radius":"5px"}),a(b).last().css({"border-bottom-left-radius":"5px","border-bottom-right-radius":"5px"});break;case"bottom":a(b).css({borderRadius:"0px 0px 0px 0px"}),a(b).first().css({borderRadius:"5px 5px 0px 0px"})}}}},modal:{css:{position:"fixed",width:"100%",height:"100%",backgroundColor:"#000",zIndex:1e4,opacity:.6,display:"none",left:0,top:0}},style:function(){switch(this.$bar.css({overflow:"hidden",background:"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAYAAAAPOoFWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPZJREFUeNq81tsOgjAMANB2ov7/7ypaN7IlIwi9rGuT8QSc9EIDAsAznxvY4pXPKr05RUE5MEVB+TyWfCEl9LZApYopCmo9C4FKSMtYoI8Bwv79aQJU4l6hXXCZrQbokJEksxHo9KMOgc6w1atHXM8K9DVC7FQnJ0i8iK3QooGgbnyKgMDygBWyYFZoqx4qS27KqLZJjA1D0jK6QJcYEQEiWv9PGkTsbqxQ8oT+ZtZB6AkdsJnQDnMoHXHLGKOgDYuCWmYhEERCI5gaamW0bnHdA3k2ltlIN+2qKRyCND0bhqSYCyTB3CAOc4WusBEIpkeBuPgJMAAX8Hs1NfqHRgAAAABJRU5ErkJggg==') repeat-x scroll left top #fff"}),this.$message.css({fontSize:"13px",lineHeight:"16px",textAlign:"center",padding:"8px 10px 9px",width:"auto",position:"relative"}),this.$closeButton.css({position:"absolute",top:4,right:4,width:10,height:10,background:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLah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/mE8Ho9Go9ErMzvJOW/1fY/JZIJSypqZfXX3L13X9fcDAKJct1sx3OiuAAAAAElFTkSuQmCC)",display:"none",cursor:"pointer"}),this.$buttons.css({padding:5,textAlign:"right",borderTop:"1px solid #ccc",backgroundColor:"#fff"}),this.$buttons.find("button").css({marginLeft:5}),this.$buttons.find("button:first").css({marginLeft:0}),this.$bar.on({mouseenter:function(){a(this).find(".noty_close").stop().fadeTo("normal",1)},mouseleave:function(){a(this).find(".noty_close").stop().fadeTo("normal",0)}}),this.options.layout.name){case"top":this.$bar.css({borderRadius:"0px 0px 5px 5px",borderBottom:"2px solid #eee",borderLeft:"2px solid #eee",borderRight:"2px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"});break;case"topCenter":case"center":case"bottomCenter":case"inline":this.$bar.css({borderRadius:"5px",border:"1px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}),this.$message.css({fontSize:"13px",textAlign:"center"});break;case"topLeft":case"topRight":case"bottomLeft":case"bottomRight":case"centerLeft":case"centerRight":this.$bar.css({borderRadius:"5px",border:"1px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"}),this.$message.css({fontSize:"13px",textAlign:"left"});break;case"bottom":this.$bar.css({borderRadius:"5px 5px 0px 0px",borderTop:"2px solid #eee",borderLeft:"2px solid #eee",borderRight:"2px solid #eee",boxShadow:"0 -2px 4px rgba(0, 0, 0, 0.1)"});break;default:this.$bar.css({border:"2px solid #eee",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)"})}switch(this.options.type){case"alert":case"notification":this.$bar.css({backgroundColor:"#FFF",borderColor:"#CCC",color:"#444"});break;case"warning":this.$bar.css({backgroundColor:"#FFEAA8",borderColor:"#FFC237",color:"#826200"}),this.$buttons.css({borderTop:"1px solid #FFC237"});break;case"error":this.$bar.css({backgroundColor:"red",borderColor:"darkred",color:"#FFF"}),this.$message.css({fontWeight:"bold"}),this.$buttons.css({borderTop:"1px solid darkred"});break;case"information":this.$bar.css({backgroundColor:"#57B7E2",borderColor:"#0B90C4",color:"#FFF"}),this.$buttons.css({borderTop:"1px solid #0B90C4"});break;case"success":this.$bar.css({backgroundColor:"lightgreen",borderColor:"#50C24E",color:"darkgreen"}),this.$buttons.css({borderTop:"1px solid #50C24E"});break;default:this.$bar.css({backgroundColor:"#FFF",borderColor:"#CCC",color:"#444"})}},callback:{onShow:function(){a.noty.themes.defaultTheme.helpers.borderFix.apply(this)},onClose:function(){a.noty.themes.defaultTheme.helpers.borderFix.apply(this)}}}}(jQuery);
|
lang/qqworld_auto_save_images-zh_CN.mo
CHANGED
Binary file
|
lang/qqworld_auto_save_images-zh_CN.po
CHANGED
@@ -3,7 +3,7 @@ msgstr ""
|
|
3 |
"Project-Id-Version: QQworld Auto Save Images\n"
|
4 |
"Report-Msgid-Bugs-To: http://www.qqworld.org\n"
|
5 |
"POT-Creation-Date: 2011-12-10 19:47:15+00:00\n"
|
6 |
-
"PO-Revision-Date: 2014-09-29
|
7 |
"Last-Translator: Michael Wang <admin@qqworld.org>\n"
|
8 |
"Language-Team: QQWorld <admin@qqworld.org>\n"
|
9 |
"Language: zh_CN\n"
|
@@ -14,6 +14,9 @@ msgstr ""
|
|
14 |
"X-Generator: Poedit 1.6.9\n"
|
15 |
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
|
|
|
|
|
|
|
17 |
msgid "Save Remote Images"
|
18 |
msgstr "保存远程图片"
|
19 |
|
@@ -44,3 +47,37 @@ msgstr "当单击编辑器顶部的按钮时,手动将所有远程图像保存
|
|
44 |
|
45 |
msgid "Automatically Set Featured Image"
|
46 |
msgstr "自动设置特色图片"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
"Project-Id-Version: QQworld Auto Save Images\n"
|
4 |
"Report-Msgid-Bugs-To: http://www.qqworld.org\n"
|
5 |
"POT-Creation-Date: 2011-12-10 19:47:15+00:00\n"
|
6 |
+
"PO-Revision-Date: 2014-09-29 20:59+0800\n"
|
7 |
"Last-Translator: Michael Wang <admin@qqworld.org>\n"
|
8 |
"Language-Team: QQWorld <admin@qqworld.org>\n"
|
9 |
"Language: zh_CN\n"
|
14 |
"X-Generator: Poedit 1.6.9\n"
|
15 |
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
|
17 |
+
msgid "QQWorld Auto Save Images"
|
18 |
+
msgstr "QQWorld自动保存图片"
|
19 |
+
|
20 |
msgid "Save Remote Images"
|
21 |
msgstr "保存远程图片"
|
22 |
|
47 |
|
48 |
msgid "Automatically Set Featured Image"
|
49 |
msgstr "自动设置特色图片"
|
50 |
+
|
51 |
+
msgid "Scan Old Posts"
|
52 |
+
msgstr "扫描旧的文章"
|
53 |
+
|
54 |
+
msgid "Scan"
|
55 |
+
msgstr "扫描"
|
56 |
+
|
57 |
+
msgid ""
|
58 |
+
"Are you sure? Before you click the yes button, I recommend you backup the "
|
59 |
+
"website database."
|
60 |
+
msgstr "你确定吗?在点击确定按钮之前,我建议你备份网站的数据库。"
|
61 |
+
|
62 |
+
msgid ""
|
63 |
+
"Scan posts and keep remote images in all posts to local media library. Maybe "
|
64 |
+
"take a long time."
|
65 |
+
msgstr "扫描所有的文章,将所有远程图片保存到本地,可能需要很长时间。"
|
66 |
+
|
67 |
+
msgid "Scanning..."
|
68 |
+
msgstr "扫描中……"
|
69 |
+
|
70 |
+
msgid "Select post types you want to scan:"
|
71 |
+
msgstr "选择想要扫描的文章类型:"
|
72 |
+
|
73 |
+
msgid "All done."
|
74 |
+
msgstr "全部完成。"
|
75 |
+
|
76 |
+
msgid "Post Type"
|
77 |
+
msgstr "文章类型"
|
78 |
+
|
79 |
+
msgid "Return"
|
80 |
+
msgstr "返回"
|
81 |
+
|
82 |
+
msgid "Please select the post type you want to scan."
|
83 |
+
msgstr "请选择要扫描的文章类型。"
|
qqworld-auto-save-images.php
CHANGED
@@ -3,10 +3,12 @@
|
|
3 |
Plugin Name: QQWorld Auto Save Images
|
4 |
Plugin URI: https://wordpress.org/plugins/qqworld-auto-save-images/
|
5 |
Description: Automatically keep the all remote picture to the local, and automatically set featured image. 自动保存远程图片到本地,自动设置特色图片,并且支持机器人采集软件从外部提交。
|
6 |
-
Version: 1.
|
7 |
Author: Michael Wang
|
8 |
Author URI: http://www.qqworld.org
|
9 |
*/
|
|
|
|
|
10 |
|
11 |
class QQWorld_auto_save_images {
|
12 |
var $using_action;
|
@@ -58,12 +60,12 @@ class QQWorld_auto_save_images {
|
|
58 |
transform: scale(1.1);
|
59 |
}
|
60 |
</style>
|
|
|
61 |
<a href="javascript:" id="save-remote-images-button" class="button save_remote_images" title="<?php _e('Save Remote Images', 'qqworld_auto_save_images'); ?>"><span class="wp-media-buttons-icon"></span><?php _e('Save Remote Images', 'qqworld_auto_save_images'); ?></a>
|
62 |
<script>
|
63 |
var QQWorld_auto_save_images = {};
|
64 |
QQWorld_auto_save_images.post_id = <?php echo $post->ID; ?>;
|
65 |
QQWorld_auto_save_images.text = {
|
66 |
-
save_remote_images: '<?php _e('Save Remote Images', 'qqworld_auto_save_images'); ?>',
|
67 |
in_process: '<?php _e('In Process...', 'qqworld_auto_save_images'); ?>',
|
68 |
succesed_save_remote_images: '<?php _e('Successed save remote images', 'qqworld_auto_save_images'); ?>'
|
69 |
}
|
@@ -71,15 +73,19 @@ class QQWorld_auto_save_images {
|
|
71 |
$(window).on('load', function() {
|
72 |
$('.mce-i-save_remote_images').closest('.mce-widget').hide();
|
73 |
$(document).on('click', '#save-remote-images-button', function() {
|
74 |
-
var
|
75 |
-
mode = 'text';
|
76 |
if (tinyMCE.activeEditor) {
|
77 |
var id = tinyMCE.activeEditor.id;
|
78 |
mode = $('#'+id).is(':visible') ? 'text' : 'virtual';
|
79 |
}
|
80 |
switch (mode) {
|
81 |
case 'text':
|
82 |
-
$('
|
|
|
|
|
|
|
|
|
|
|
83 |
$.ajax({
|
84 |
type: "POST",
|
85 |
url: ajaxurl,
|
@@ -89,17 +95,24 @@ class QQWorld_auto_save_images {
|
|
89 |
content: escape($('#content').val())
|
90 |
},
|
91 |
success: function(respond) {
|
92 |
-
$('
|
93 |
-
var
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
|
|
|
|
98 |
}
|
99 |
});
|
100 |
break;
|
101 |
case 'virtual':
|
102 |
-
$('
|
|
|
|
|
|
|
|
|
|
|
103 |
$.ajax({
|
104 |
type: "POST",
|
105 |
url: ajaxurl,
|
@@ -109,12 +122,14 @@ class QQWorld_auto_save_images {
|
|
109 |
content: escape(tinyMCE.activeEditor.getContent())
|
110 |
},
|
111 |
success: function(respond) {
|
112 |
-
$('
|
113 |
-
var
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
116 |
if (respond) tinyMCE.activeEditor.setContent(respond);
|
117 |
-
setTimeout(init, 3000);
|
118 |
}
|
119 |
});
|
120 |
break;
|
@@ -140,16 +155,20 @@ class QQWorld_auto_save_images {
|
|
140 |
}
|
141 |
|
142 |
function admin_menu() {
|
143 |
-
add_submenu_page('options-general.php', 'QQWorld Auto Save Images', 'QQWorld Auto Save Images', 'manage_options', 'qqworld-auto-save-images', array($this, 'fn'));
|
144 |
}
|
145 |
|
146 |
function fn() {
|
147 |
?>
|
148 |
<div class="wrap">
|
149 |
-
<h2><?php _e('QQWorld Auto Save Images'); ?></h2>
|
150 |
<?php if ($_GET['updated']=='true') { ?><div class="updated settings-error" id="setting-error-settings_updated"><p><strong><?php _e('Settings saved.'); ?></strong></p></div><?php }; ?>
|
151 |
-
<
|
|
|
|
|
|
|
152 |
<?php settings_fields('qqworld_auto_save_images_settings'); ?>
|
|
|
153 |
<table class="form-table">
|
154 |
<tbody>
|
155 |
<tr valign="top">
|
@@ -166,6 +185,21 @@ class QQWorld_auto_save_images {
|
|
166 |
</label>
|
167 |
</fieldset></td>
|
168 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
<tr valign="top">
|
171 |
<th scope="row"><label><?php _e('Automatically Set Featured Image', 'qqworld_auto_save_images'); ?></label></th>
|
@@ -181,33 +215,147 @@ class QQWorld_auto_save_images {
|
|
181 |
</label>
|
182 |
</fieldset></td>
|
183 |
</tr>
|
184 |
-
|
185 |
-
<tr
|
186 |
-
<th scope="row"><label><?php _e('
|
187 |
-
<td
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
|
|
|
|
|
|
|
|
|
|
196 |
</label>
|
|
|
197 |
</fieldset></td>
|
198 |
</tr>
|
199 |
</tbody>
|
200 |
</table>
|
201 |
<script>
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
</script>
|
209 |
<p class="submit"><input type="submit" value="<?php _e('Save Changes') ?>" class="button-primary" name="Submit" /></p>
|
210 |
</form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
<?php
|
212 |
}
|
213 |
|
3 |
Plugin Name: QQWorld Auto Save Images
|
4 |
Plugin URI: https://wordpress.org/plugins/qqworld-auto-save-images/
|
5 |
Description: Automatically keep the all remote picture to the local, and automatically set featured image. 自动保存远程图片到本地,自动设置特色图片,并且支持机器人采集软件从外部提交。
|
6 |
+
Version: 1.5.2
|
7 |
Author: Michael Wang
|
8 |
Author URI: http://www.qqworld.org
|
9 |
*/
|
10 |
+
define('QQWORLD_AUTO_SAVE_IMAGES_DIR', __DIR__ . DIRECTORY_SEPARATOR);
|
11 |
+
define('QQWORLD_AUTO_SAVE_IMAGES_URL', plugin_dir_url(__FILE__));
|
12 |
|
13 |
class QQWorld_auto_save_images {
|
14 |
var $using_action;
|
60 |
transform: scale(1.1);
|
61 |
}
|
62 |
</style>
|
63 |
+
<script src="<?php echo QQWORLD_AUTO_SAVE_IMAGES_URL; ?>js/jquery.noty.packaged.min.js"></script>
|
64 |
<a href="javascript:" id="save-remote-images-button" class="button save_remote_images" title="<?php _e('Save Remote Images', 'qqworld_auto_save_images'); ?>"><span class="wp-media-buttons-icon"></span><?php _e('Save Remote Images', 'qqworld_auto_save_images'); ?></a>
|
65 |
<script>
|
66 |
var QQWorld_auto_save_images = {};
|
67 |
QQWorld_auto_save_images.post_id = <?php echo $post->ID; ?>;
|
68 |
QQWorld_auto_save_images.text = {
|
|
|
69 |
in_process: '<?php _e('In Process...', 'qqworld_auto_save_images'); ?>',
|
70 |
succesed_save_remote_images: '<?php _e('Successed save remote images', 'qqworld_auto_save_images'); ?>'
|
71 |
}
|
73 |
$(window).on('load', function() {
|
74 |
$('.mce-i-save_remote_images').closest('.mce-widget').hide();
|
75 |
$(document).on('click', '#save-remote-images-button', function() {
|
76 |
+
var mode = 'text';
|
|
|
77 |
if (tinyMCE.activeEditor) {
|
78 |
var id = tinyMCE.activeEditor.id;
|
79 |
mode = $('#'+id).is(':visible') ? 'text' : 'virtual';
|
80 |
}
|
81 |
switch (mode) {
|
82 |
case 'text':
|
83 |
+
$('#save-remote-images-button').data('noty', noty({
|
84 |
+
text: QQWorld_auto_save_images.text.in_process,
|
85 |
+
type: 'notification',
|
86 |
+
layout: 'center',
|
87 |
+
modal: true
|
88 |
+
}) );
|
89 |
$.ajax({
|
90 |
type: "POST",
|
91 |
url: ajaxurl,
|
95 |
content: escape($('#content').val())
|
96 |
},
|
97 |
success: function(respond) {
|
98 |
+
$('#save-remote-images-button').data('noty').close();
|
99 |
+
var n = noty({
|
100 |
+
text: QQWorld_auto_save_images.text.succesed_save_remote_images,
|
101 |
+
type: 'success',
|
102 |
+
layout: 'center',
|
103 |
+
timeout: 3000
|
104 |
+
});
|
105 |
+
if (respond) $('#content').val(respond);
|
106 |
}
|
107 |
});
|
108 |
break;
|
109 |
case 'virtual':
|
110 |
+
$('#save-remote-images-button').data('noty', noty({
|
111 |
+
text: QQWorld_auto_save_images.text.in_process,
|
112 |
+
type: 'notification',
|
113 |
+
layout: 'center',
|
114 |
+
modal: true
|
115 |
+
}) );
|
116 |
$.ajax({
|
117 |
type: "POST",
|
118 |
url: ajaxurl,
|
122 |
content: escape(tinyMCE.activeEditor.getContent())
|
123 |
},
|
124 |
success: function(respond) {
|
125 |
+
$('#save-remote-images-button').data('noty').close();
|
126 |
+
var n = noty({
|
127 |
+
text: QQWorld_auto_save_images.text.succesed_save_remote_images,
|
128 |
+
type: 'success',
|
129 |
+
layout: 'center',
|
130 |
+
timeout: 3000
|
131 |
+
});
|
132 |
if (respond) tinyMCE.activeEditor.setContent(respond);
|
|
|
133 |
}
|
134 |
});
|
135 |
break;
|
155 |
}
|
156 |
|
157 |
function admin_menu() {
|
158 |
+
add_submenu_page('options-general.php', __('QQWorld Auto Save Images', 'qqworld_auto_save_images'), __('QQWorld Auto Save Images', 'qqworld_auto_save_images'), 'manage_options', 'qqworld-auto-save-images', array($this, 'fn'));
|
159 |
}
|
160 |
|
161 |
function fn() {
|
162 |
?>
|
163 |
<div class="wrap">
|
164 |
+
<h2><?php _e('QQWorld Auto Save Images', 'qqworld_auto_save_images'); ?></h2>
|
165 |
<?php if ($_GET['updated']=='true') { ?><div class="updated settings-error" id="setting-error-settings_updated"><p><strong><?php _e('Settings saved.'); ?></strong></p></div><?php }; ?>
|
166 |
+
<script src="<?php echo QQWORLD_AUTO_SAVE_IMAGES_URL; ?>js/jquery.noty.packaged.min.js"></script>
|
167 |
+
<link rel='stylesheet' href='<?php echo QQWORLD_AUTO_SAVE_IMAGES_URL; ?>css/style.css' type='text/css' media='all' />
|
168 |
+
<?php if (empty($_POST)) : ?>
|
169 |
+
<form action="options.php" method="post" id="form">
|
170 |
<?php settings_fields('qqworld_auto_save_images_settings'); ?>
|
171 |
+
<img src="https://ps.w.org/qqworld-auto-save-images/assets/banner-772x250.png" width="772" height="250" id="banner" />
|
172 |
<table class="form-table">
|
173 |
<tbody>
|
174 |
<tr valign="top">
|
185 |
</label>
|
186 |
</fieldset></td>
|
187 |
</tr>
|
188 |
+
|
189 |
+
<tr id="second_level" valign="top"<?php if ($this->type != 'auto') echo ' style="display: none;"'; ?>>
|
190 |
+
<th scope="row"><label><?php _e('When', 'qqworld_auto_save_images'); ?></label></th>
|
191 |
+
<td><fieldset>
|
192 |
+
<legend class="screen-reader-text"><span><?php _e('When', 'qqworld_auto_save_images'); ?></span></legend>
|
193 |
+
<label for="save">
|
194 |
+
<input name="using_action" type="radio" id="save" value="save" <?php checked('save', $this->using_action); ?> />
|
195 |
+
<?php _e('Save post (Publish, save draft or pedding review).', 'qqworld_auto_save_images'); ?>
|
196 |
+
</label><br />
|
197 |
+
<label for="publish">
|
198 |
+
<input name="using_action" type="radio" id="publish" value="publish" <?php checked('publish', $this->using_action); ?> />
|
199 |
+
<?php _e('Publish post only.', 'qqworld_auto_save_images'); ?>
|
200 |
+
</label>
|
201 |
+
</fieldset></td>
|
202 |
+
</tr>
|
203 |
|
204 |
<tr valign="top">
|
205 |
<th scope="row"><label><?php _e('Automatically Set Featured Image', 'qqworld_auto_save_images'); ?></label></th>
|
215 |
</label>
|
216 |
</fieldset></td>
|
217 |
</tr>
|
218 |
+
|
219 |
+
<tr valign="top">
|
220 |
+
<th scope="row"><label><?php _e('Scan Old Posts', 'qqworld_auto_save_images'); ?></label></th>
|
221 |
+
<td>
|
222 |
+
<p><?php _e('Select post types you want to scan:', 'qqworld_auto_save_images'); ?></p>
|
223 |
+
<p id="post_types_list">
|
224 |
+
<?php
|
225 |
+
$post_types = get_post_types('', 'objects');
|
226 |
+
foreach ($post_types as $name => $post_type) : ?>
|
227 |
+
<label><input name="qqworld_auto_save_imagess_post_types[]" type="checkbox" value="<?php echo $name; ?>" /> <?php echo $post_type->labels->name; ?></label>
|
228 |
+
<?php endforeach;
|
229 |
+
?>
|
230 |
+
</p>
|
231 |
+
<fieldset>
|
232 |
+
<legend class="screen-reader-text"><span><?php _e('Scan Old Posts', 'qqworld_auto_save_images'); ?></span></legend>
|
233 |
+
<label for="scan_old_posts">
|
234 |
+
<input name="scan_old_posts" type="submit" class="button-primary" id="scan_old_posts" value="<?php _e('Scan', 'qqworld_auto_save_images'); ?>" />
|
235 |
</label>
|
236 |
+
<p class="description"><?php _e('Scan posts and keep remote images in all posts to local media library. Maybe take a long time.', 'qqworld_auto_save_images'); ?></p>
|
237 |
</fieldset></td>
|
238 |
</tr>
|
239 |
</tbody>
|
240 |
</table>
|
241 |
<script>
|
242 |
+
if (!QQWorld_auto_save_images) var QQWorld_auto_save_images = {};
|
243 |
+
QQWorld_auto_save_images.are_your_sure = '<?php _e('Are you sure? Before you click the yes button, I recommend you backup the website database.', 'qqworld_auto_save_images'); ?>';
|
244 |
+
QQWorld_auto_save_images.events = function() {
|
245 |
+
var $ = jQuery;
|
246 |
+
$('#auto').on('click', function() {
|
247 |
+
$('#second_level').fadeIn('fast');
|
248 |
+
});
|
249 |
+
$('#manual').on('click', function() {
|
250 |
+
$('#second_level').fadeOut('fast');
|
251 |
+
});
|
252 |
+
$('#scan_old_posts').on('click', function() {
|
253 |
+
if (jQuery('input[name="qqworld_auto_save_imagess_post_types[]"]:checked').length) {
|
254 |
+
var n = noty({
|
255 |
+
text: QQWorld_auto_save_images.are_your_sure,
|
256 |
+
type: 'warning',
|
257 |
+
dismissQueue: true,
|
258 |
+
layout: 'center',
|
259 |
+
modal: true,
|
260 |
+
buttons: [
|
261 |
+
{
|
262 |
+
addClass: 'button button-primary',
|
263 |
+
text: '<?php _e('Yes'); ?>',
|
264 |
+
onClick: function ($noty) {
|
265 |
+
$noty.close();
|
266 |
+
$('#form').attr('action', '').submit();
|
267 |
+
}
|
268 |
+
},
|
269 |
+
{
|
270 |
+
addClass: 'button button-primary',
|
271 |
+
text: '<?php _e('No'); ?>',
|
272 |
+
onClick: function ($noty) {
|
273 |
+
$noty.close();
|
274 |
+
}
|
275 |
+
}
|
276 |
+
]
|
277 |
+
});
|
278 |
+
} else {
|
279 |
+
var n = noty({
|
280 |
+
text: '<?php _e('Please select the post type you want to scan.', 'qqworld_auto_save_images'); ?>',
|
281 |
+
type: 'error',
|
282 |
+
dismissQueue: true,
|
283 |
+
layout: 'bottomCenter',
|
284 |
+
timeout: 3000
|
285 |
+
});
|
286 |
+
}
|
287 |
+
return false;
|
288 |
+
});
|
289 |
+
};
|
290 |
+
QQWorld_auto_save_images.events();
|
291 |
</script>
|
292 |
<p class="submit"><input type="submit" value="<?php _e('Save Changes') ?>" class="button-primary" name="Submit" /></p>
|
293 |
</form>
|
294 |
+
<?php elseif ( isset($_POST['qqworld_auto_save_imagess_post_types']) ): ?>
|
295 |
+
<script>
|
296 |
+
var n = noty({
|
297 |
+
text: '<?php _e('Scanning...', 'qqworld_auto_save_images'); ?>',
|
298 |
+
type: 'notification',
|
299 |
+
layout: 'topCenter'
|
300 |
+
});
|
301 |
+
</script>
|
302 |
+
<?php
|
303 |
+
set_time_limit(0);
|
304 |
+
$post_types = $_POST['qqworld_auto_save_imagess_post_types'];
|
305 |
+
$args = array(
|
306 |
+
'posts_per_page' => -1,
|
307 |
+
'order' => 'ASC',
|
308 |
+
'post_type' => $post_types,
|
309 |
+
);
|
310 |
+
$posts = get_posts($args);
|
311 |
+
if (!empty($posts)) : ?>
|
312 |
+
<table id="scan_old_post_list">
|
313 |
+
<thead>
|
314 |
+
<th><?php _e('ID'); ?></th>
|
315 |
+
<th><?php _e('Post Type', 'qqworld_auto_save_images'); ?></th>
|
316 |
+
<th><?php _e('Title'); ?></th>
|
317 |
+
<th><?php _e('Status'); ?></th>
|
318 |
+
</thead>
|
319 |
+
<tbody>
|
320 |
+
<?php foreach ($posts as $post) :
|
321 |
+
$post_id = $post->ID;
|
322 |
+
$post_type = $post->post_type;
|
323 |
+
$content = $post->post_content;
|
324 |
+
$title = $post->post_title;
|
325 |
+
$preg=preg_match_all('/<img.*?src="((?![\"\']).*?)((?![\"\'])\?.*?)?"/',stripslashes($content),$matches);
|
326 |
+
if($preg){
|
327 |
+
foreach($matches[1] as $image_url){
|
328 |
+
if(empty($image_url)) continue;
|
329 |
+
$pos=strpos($image_url,get_bloginfo('url'));
|
330 |
+
if($pos===false){
|
331 |
+
if ($res=$this->save_images($image_url,$post_id)) {
|
332 |
+
$replace=$res['url'];
|
333 |
+
$content=str_replace($image_url,$replace,$content);
|
334 |
+
}
|
335 |
+
}
|
336 |
+
}
|
337 |
+
}
|
338 |
+
wp_update_post(array('ID' => $post_id, 'post_content' => $content)); ?>
|
339 |
+
<tr>
|
340 |
+
<td><?php echo $post_id; ?></td>
|
341 |
+
<td><?php echo $post_type; ?></td>
|
342 |
+
<td><a href="<?php echo get_edit_post_link($post_id); ?>" target="_blank"><?php echo $title; ?></a></td>
|
343 |
+
<td><?php _e('Done'); ?></td></tr>
|
344 |
+
<?php endforeach; ?>
|
345 |
+
</tbody>
|
346 |
+
</table>
|
347 |
+
<script>
|
348 |
+
n.close();
|
349 |
+
noty({
|
350 |
+
text: '<?php _e('All done.', 'qqworld_auto_save_images'); ?>',
|
351 |
+
type: 'success',
|
352 |
+
layout: 'topCenter',
|
353 |
+
timeout: 3000
|
354 |
+
});
|
355 |
+
</script>
|
356 |
+
<p><a href="<?php echo menu_page_url( 'qqworld-auto-save-images', 0 ); ?>" class="button button-primary"><?php _e('Return', 'qqworld_auto_save_images') ?></a></p>
|
357 |
+
<?php endif;
|
358 |
+
endif; ?>
|
359 |
<?php
|
360 |
}
|
361 |
|