Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
afb5cfc
commit 4262772
Showing
4 changed files
with
66 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,65 @@ | ||
/*global jsToolBar, dotclear */ | ||
/*global $, jQuery, jsToolBar, dotclear */ | ||
'use strict'; | ||
|
||
jsToolBar.prototype.elements.yashSpace = { | ||
type: 'space', | ||
format: { | ||
wysiwyg: true, | ||
wiki: true, | ||
xhtml: true, | ||
markdown: true, | ||
}, | ||
}; | ||
$(() => { | ||
const data = dotclear.getData('dc_editor_yash'); | ||
|
||
jsToolBar.prototype.elements.yash = { | ||
type: 'button', | ||
title: dotclear.getData('dc_editor_yash').title || 'Highlighted Code', | ||
context: 'post', | ||
icon: 'index.php?pf=yash/icon.svg', | ||
shortkey: 'KeyY', | ||
shortkey_name: 'Y', | ||
fn: {}, | ||
fncall: {}, | ||
open_url: 'plugin.php?p=yash&popup=1', | ||
data: {}, | ||
popup() { | ||
window.the_toolbar = this; | ||
this.elements.yash.data = {}; | ||
jsToolBar.prototype.elements.yashSpace = { | ||
type: 'space', | ||
format: { | ||
wysiwyg: true, | ||
wiki: true, | ||
xhtml: true, | ||
markdown: true, | ||
}, | ||
}; | ||
|
||
window.open( | ||
this.elements.yash.open_url, | ||
'dc_popup', | ||
'alwaysRaised=yes,dependent=yes,toolbar=yes,height=240,width=480,menubar=no,resizable=yes,scrollbars=yes,status=no', | ||
); | ||
}, | ||
}; | ||
jsToolBar.prototype.elements.yash = { | ||
type: 'button', | ||
title: data.title || 'Highlighted Code', | ||
context: 'post', | ||
icon: data.icon, | ||
shortkey: 'KeyY', | ||
shortkey_name: 'Y', | ||
fn: {}, | ||
fncall: {}, | ||
open_url: data.open_url, | ||
data: {}, | ||
popup() { | ||
window.the_toolbar = this; | ||
this.elements.yash.data = {}; | ||
|
||
jsToolBar.prototype.elements.yash.fn.wiki = function () { | ||
this.elements.yash.popup.call(this); | ||
}; | ||
jsToolBar.prototype.elements.yash.fn.xhtml = function () { | ||
this.elements.yash.popup.call(this); | ||
}; | ||
jsToolBar.prototype.elements.yash.fn.markdown = function () { | ||
this.elements.yash.popup.call(this); | ||
}; | ||
window.open( | ||
this.elements.yash.open_url, | ||
'dc_popup', | ||
'alwaysRaised=yes,dependent=yes,toolbar=yes,height=240,width=480,menubar=no,resizable=yes,scrollbars=yes,status=no', | ||
); | ||
}, | ||
}; | ||
|
||
jsToolBar.prototype.elements.yash.fncall.wiki = function () { | ||
const stag = `\n///yash ${this.elements.yash.data.syntax}\n`; | ||
const etag = '\n///\n'; | ||
this.encloseSelection(stag, etag); | ||
}; | ||
jsToolBar.prototype.elements.yash.fncall.xhtml = function () { | ||
const stag = `<pre class="brush: ${this.elements.yash.data.syntax}">\n`; | ||
const etag = '\n</pre>\n'; | ||
this.encloseSelection(stag, etag); | ||
}; | ||
jsToolBar.prototype.elements.yash.fncall.markdown = function () { | ||
const stag = `<pre class="brush: ${this.elements.yash.data.syntax}">\n`; | ||
const etag = '\n</pre>\n'; | ||
this.encloseSelection(stag, etag); | ||
}; | ||
jsToolBar.prototype.elements.yash.fn.wiki = function () { | ||
this.elements.yash.popup.call(this); | ||
}; | ||
jsToolBar.prototype.elements.yash.fn.xhtml = function () { | ||
this.elements.yash.popup.call(this); | ||
}; | ||
jsToolBar.prototype.elements.yash.fn.markdown = function () { | ||
this.elements.yash.popup.call(this); | ||
}; | ||
|
||
jsToolBar.prototype.elements.yash.fncall.wiki = function () { | ||
const stag = `\n///yash ${this.elements.yash.data.syntax}\n`; | ||
const etag = '\n///\n'; | ||
this.encloseSelection(stag, etag); | ||
}; | ||
jsToolBar.prototype.elements.yash.fncall.xhtml = function () { | ||
const stag = `<pre class="brush: ${this.elements.yash.data.syntax}">\n`; | ||
const etag = '\n</pre>\n'; | ||
this.encloseSelection(stag, etag); | ||
}; | ||
jsToolBar.prototype.elements.yash.fncall.markdown = function () { | ||
const stag = `<pre class="brush: ${this.elements.yash.data.syntax}">\n`; | ||
const etag = '\n</pre>\n'; | ||
this.encloseSelection(stag, etag); | ||
}; | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters