[WordPress] 外掛分享: Save Me

首頁外掛目錄 › Save Me
10+
安裝啟用
☆☆☆☆
1/5 分(1 則評價)
5482 天前
最後更新
問題解決
WordPress 3.0+ v1.1 上架:2011-03-17

內容簡介

Save Me 外掛能夠防止 WordPress 網頁編輯器使 JavaScript 與其它行內嵌入代碼失真。您可以在編輯器的「視覺效果」模式中,將您的代碼用短碼 [saveme][/saveme] 框起來以加入比較可控制的方式。

儘管您可以不使用外掛而直接在 HTML 編輯模式下貼上 JavaScript 代碼,但反覆在 HTML 與視覺效果模式下切換時,該代碼常常會被扭曲。例如,TinyMCE 編輯器會刪除其無法解讀的元素,像是那些需要 JavaScript 或 AJAX 小工具來插入內容的空 div。因為 JavaScript 代碼在視覺效果編輯器中沒有顯示,所以很容易不小心刪除它。

在使用 Save Me 網頁小工具時,編輯器會將您的代碼當成是一個您正在撰寫的程式碼範例,而不是會執行的腳本。您可能會看到一些變形,例如雙引號被轉換成弯引號,但至少您可以更容易地追蹤您的代碼插入位置。Save Me 短碼函數可逆轉 HTML 實體轉換,而將您的 JavaScript 小工具轉換回可執行代碼。

Save Me 短碼已經通過 Facebook 社交工具與 Google Adsense JavaScript 區塊的測試。如果您的 JavaScript 經過此函數傳遞後仍然無法正常運行,請透過 Carr Communications Inc. 與我聯繫,我會嘗試找出原因。

這是 Facebook Tab Manager for WordPress 的類似函數的衍生品。

尊榮標誌
Facebook Tab Manager
Copyright (C) 2011 David F. Carr

本程式是自由軟體,您可以重新分發或自行修改它
根據自由軟體基金會發佈的 GNU 通用公眾授權條款
無論任何時間您都可以選擇使用的版本。

此程式同時遵循使用上的一般原則
但不提供任何明示或暗示的保證
包括但不限於適售性或用於特定用途之保證
更多請參閱 GNU 通用公眾授權條款。

參見 <http://www.gnu.org/licenses/> 的 GNU 通用公眾授權條款。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Save Me」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

The Save Me plugin saves JavaScript and other inline code from distortion by the WordPress rich text editor. Add code in the editor’s VISUAL mode, bracketing it with the shortcode [saveme][/saveme].
While it is possible without a plugin to switch to HTML editing mode and paste JavaScript into a post, often the code will be scrambled if you toggle back and forth between the HTML and Visual modes. For example, the TinyMCE editor sometimes eliminates what it doesn’t understand — like empty divs into which your JavaScript or AJAX widget needs to inject content. And since JavaScript code is not displayed with any representation in the visual editor, it’s easy to accidentally delete.
In rich tech mode, the editor will treat your code as if it were a code sample you were writing about, rather than a script to be executed. You may see distortions, like quotation marks being turned into curly quotes, but at least you can keep track of where you inserted the code. The saveme shortcode function reverses HTML entity transformations and turns your JavaScript widget back into executable code.
The saveme shortcode has been tested with Facebook social widgets and Google Adsense JavaScript blocks. If you encounter JavaScript that does not work after being passed through this function, contact me through Carr Communications Inc. and I will try to determine why not.
This is a spinoff of a similar function in Facebook Tab Manager for WordPress
Credits
Facebook Tab Manager
Copyright (C) 2011 David F. Carr

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

See the GNU General Public License at .

延伸相關外掛

文章
Filter
Apply Filters
Mastodon