测试广告 Push

This commit is contained in:
2026-02-09 11:29:37 -05:00
parent a5183cfea8
commit 82c89e4aac
3 changed files with 17 additions and 8 deletions
+11 -2
View File
@@ -7,6 +7,7 @@
<list default="true" id="fa3ca596-285f-4ed7-a3a4-7b1482493fd4" name="Changes" comment="调试 Google 广告">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/docs/docsify-plugin-ads.js" beforeDir="false" afterPath="$PROJECT_DIR$/docs/docsify-plugin-ads.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/docs/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/docs/index.html" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -90,7 +91,7 @@
<option name="presentableId" value="Default" />
<updated>1716613044992</updated>
<workItem from="1770483844428" duration="453000" />
<workItem from="1770641739752" duration="10449000" />
<workItem from="1770641739752" duration="10823000" />
</task>
<task id="LOCAL-00001" summary="更新編輯按鈕">
<option name="closed" value="true" />
@@ -140,7 +141,15 @@
<option name="project" value="LOCAL" />
<updated>1770653711582</updated>
</task>
<option name="localTasksCounter" value="7" />
<task id="LOCAL-00007" summary="调试 Google 广告">
<option name="closed" value="true" />
<created>1770654181674</created>
<option name="number" value="00007" />
<option name="presentableId" value="LOCAL-00007" />
<option name="project" value="LOCAL" />
<updated>1770654181674</updated>
</task>
<option name="localTasksCounter" value="8" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
+5 -5
View File
@@ -1,18 +1,18 @@
(function(window) {
window.DocsifyAds = {
create(caPub) {
create(caPub, slot) {
return function(hook, vm) {
hook.ready(function() {
window.DocsifyAds.injectCarbonStyle();
});
hook.doneEach(function() {
window.DocsifyAds.injectScript(caPub);
window.DocsifyAds.injectScript(caPub, slot);
});
};
},
injectScript(caPub) {
injectScript(caPub, slot) {
const adEl = document.querySelector("#adsense");
const scriptID = "_adsense_js";
const sidebarEl = document.querySelector(".sidebar-nav");
@@ -35,8 +35,8 @@
scriptIns = document.createElement("ins");
scriptIns.className = `adsbygoogle`;
scriptIns.style = 'display:inline-block;width:300px;height:150px';
scriptIns.setAttribute("data-ad-client", "ca-pub-4797644559430915");
scriptIns.setAttribute("data-ad-slot", "1781911644");
scriptIns.setAttribute("data-ad-client", `${caPub}`);
scriptIns.setAttribute("data-ad-slot", `${caPub}`);
scriptAdPush = document.createElement("script");
scriptAdPush.text = "(adsbygoogle = window.adsbygoogle || []).push({});";
+1 -1
View File
@@ -160,7 +160,7 @@
},
},
plugins: [
DocsifyAds.create('ca-pub-4797644559430915'),
DocsifyAds.create('ca-pub-4797644559430915', '1781911644'),
function (hook, vm) {
hook.beforeEach(function (html) {