2021年7月6日 星期二

[筆記]TinyMCE自訂快速鍵

                  editor.addShortcut(

                    'meta+v', '純文字貼上', function (e) {

                        editor.insertContent('<b>請勿使用Ctrl+V貼上</b>');//寫提醒文字

                        editor.execCommand('mcePasteText',false); //不處理貼上的文字

                    });             

                    

[筆記]TinyMCE相關貼上禁止事件

                plugins: [

                    "advlist autolink lists link image charmap print preview anchor",

                    "searchreplace visualblocks code fullscreen",

                    "insertdatetime media table contextmenu paste"

                ],

                paste_preprocess: function (plugin, args) {

                    console.log("Attempted to paste: ", args.content);

                    // replace copied text with empty string

                    args.content = '禁止貼上';                   

                }


  • plugins:禁止右鍵選單。(無法貼上)
  • 按鍵貼上:
    • Ctrl+V or Ctrl+Shift+V 。
    • 貼上後觸發事件(paste_preprocess)。
    • 這邊可以實作貼上後觸發警告或其它。



[筆記]TinyMCE/SummerNote純文字貼上

參考:

  1. https://www.gushiciku.cn/pl/pTP3/zh-tw
  2. https://stackoverflow.com/questions/56056893/how-to-disable-copy-paste-in-tinymce
  3. summernote也是類似的作法:
    1. https://www.796t.com/post/MWJycGc=.html
  4. 註冊事件:
    1. editor.on('paste',function(){...});


語法:

[筆記]拖曳區塊

參考:

  1. https://pjchender.blogspot.com/2017/08/html5-drag-and-drop-api.html
  2. https://www.w3schools.com/html/html5_draganddrop.asp

2021年7月1日 星期四

[筆記]測試社團成員語法

2021年6月28日 星期一

[筆記]Azure SQL 新增外部資料表

參考:

  • https://docs.microsoft.com/zh-tw/sql/t-sql/statements/create-external-table-transact-sql?view=sql-server-ver15&tabs=dedicated


1.先建立連線

2.資料表語法

CREATE EXTERNAL TABLE [dbo].[MyTable]

(

[Id] [varchar](64) NULL,

[Name] [varchar](64) NULL


)

WITH (DATA_SOURCE = [MyDataSource])

GO



2021年6月10日 星期四

[筆記]網頁產生PDF相關

參考:

  • [C#][iTextSharp] PDF 套版:
    • https://ithelp.ithome.com.tw/articles/10190232
  • Create HTML 5 charts export them to PDF for free:
    • https://anthonygiretti.com/2015/12/20/create-html-5-charts-export-them-to-pdf-for-free
  • https://gist.github.com/relyky/005f1a3397ee2de43d64a98d927079cc
筆記關鍵字: 

  1. iTextSharp
  2. html canvas to pdf