Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update jquery.popline.social.js #48

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,4 @@ License
Copyright (c) 2014 kenshin54. Distributed under the MIT License. See LICENSE.txt for further details.


[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/kenshin54/popline/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

19 changes: 19 additions & 0 deletions scripts/plugins/jquery.popline.addimage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
jquery.popline.addimage.js 1.0.0

Version: 1.0.0
Updated: Jan 31th, 2023
(c) 2023 by Mons (https://github.com/blyamur)
*/
;(function($) {

$.popline.addButton({
addimage: {
iconClass: "fa fa-image",
mode: "edit",
action: function(event, popline) {
document.execCommand("insertHTML", false, "<br><br><img src=\""+$.popline.utils.selection().text().trim()+"\"><br><br>" );
},
}
});
})(jQuery);
17 changes: 12 additions & 5 deletions scripts/plugins/jquery.popline.decoration.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
jquery.popline.decoration.js 1.0.0

Version: 1.0.0
Updated: Sep 10th, 2014

(c) 2014 by kenshin54
Updated: Jan 31th, 2023, Mons (https://github.com/blyamur)
(c) 2014 by kenshin54
*/
;(function($) {

Expand All @@ -29,10 +28,18 @@
iconClass: "fa fa-strikethrough",
mode: "edit",
action: function(event) {
document.execCommand("strikethrough");
document.execCommand('strikethrough', false, null);
}
},
horisontal_line: {
iconClass: "fa fa-h-square",
mode: "edit",
action: function(event) {
var selectedText = $.popline.utils.selection().text();
var cleanText = selectedText.replace(/<[^>]*>/g, '');
document.execCommand("insertHTML", false, cleanText + "<hr>");
}
},

underline: {
iconClass: "fa fa-underline",
mode: "edit",
Expand Down
19 changes: 19 additions & 0 deletions scripts/plugins/jquery.popline.removeformat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
jquery.popline.removeformat.js 1.0.0

Version: 1.0.0
Updated: Jan 27th, 2023
(c) 2023 by (c) 2023 by Mons (https://github.com/blyamur)
*/

;(function($) {
$.popline.addButton({
removeFormat: {
iconClass: "fa fa-eraser",
mode: "edit",
action: function(event) {
document.execCommand("removeFormat");
}
}
});
})(jQuery);
44 changes: 39 additions & 5 deletions scripts/plugins/jquery.popline.social.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
jquery.popline.social.js 1.0.0

Version: 1.0.0
Updated: Sep 10th, 2014

Version: 1.0.1
Updated: Jan 23th, 2023
Mons (https://github.com/blyamur)
(c) 2014 by kenshin54
*/
;(function($) {
Expand Down Expand Up @@ -36,23 +36,57 @@
openWindow(url, true);
}
},
vkcom: {
iconClass: "fa fa-vk",
mode: "view",
action: function(event) {
var url = "https://www.vk.com/share.php";
params = [];
params.push("title=" + encodeURIComponent($.popline.utils.selection().text()));
params.push("url=" + encodeURIComponent(location.href));
openWindow(url + "?" + params.join("&"), true);
}
},
okru: {
iconClass: "fa fa-odnoklassniki",
mode: "view",
action: function(event) {
var url = "https://connect.ok.ru/offer";
params = [];
params.push("title=" + encodeURIComponent($.popline.utils.selection().text()));
params.push("url=" + encodeURIComponent(location.href));
openWindow(url + "?" + params.join("&"), true);
}
},
facebook: {
iconClass: "fa fa-facebook",
mode: "view",
action: function(event) {
var url = "http://www.facebook.com/sharer.php";
var url = "https://www.facebook.com/sharer.php";
params = [];
params.push("s=100");
params.push("p[summary]=" + encodeURIComponent($.popline.utils.selection().text()));
params.push("p[url]=" + encodeURIComponent(location.href));
openWindow(url + "?" + params.join("&"), true);
}
},
trileru: {
iconClass: "fa fa-compress",
mode: "view",
action: function(event) {
var url = "https://3le.ru/api/";
params = [];
params.push("social=" + encodeURIComponent('3LE'));
params.push("apik=" + encodeURIComponent('3LE'));
params.push("url=" + encodeURIComponent(location.href));
openWindow(url + "?" + params.join("&"), true);
}
},
pinterest: {
iconClass: "fa fa-pinterest",
mode: "view",
action: function(event) {
var url = "http://pinterest.com/pin/create/button/";
var url = "https://pinterest.com/pin/create/button/";
var range = $.popline.utils.selection().range();
var fragment = null;
if ($.popline.utils.browser.ieLtIE9()) {
Expand Down