├── README.markdown
├── blogode.js
├── config
├── blog.json
├── database.json
└── plugins.json
├── controllers
├── admin.js
├── pages.js
└── posts.js
├── filters
└── admin.js
├── install.sh
├── lib
├── comments.js
├── config.js
├── database.js
├── helper.js
├── importer.js
├── pages.js
├── plugins.js
├── posts.js
├── tags.js
└── users.js
├── plugins
├── twitter_search
│ ├── plugin.js
│ └── view.html
└── user_tweets
│ ├── plugin.js
│ └── view.html
├── public
├── stylesheet.css
├── templates
│ ├── default_theme
│ │ ├── info.json
│ │ ├── layout.html
│ │ ├── posts
│ │ │ ├── index.html
│ │ │ └── show.html
│ │ └── stylesheet.css
│ ├── initial_theme
│ │ ├── info.json
│ │ ├── layout.html
│ │ ├── pages
│ │ │ └── show.html
│ │ ├── posts
│ │ │ ├── index.html
│ │ │ ├── search.html
│ │ │ └── show.html
│ │ └── stylesheet.css
│ ├── my_other_theme
│ │ ├── info.json
│ │ ├── layout.html
│ │ ├── pages
│ │ │ └── show.html
│ │ ├── posts
│ │ │ ├── index.html
│ │ │ ├── search.html
│ │ │ └── show.html
│ │ └── stylesheet.css
│ └── pedrofranceschi.com
│ │ ├── info.json
│ │ ├── layout.html
│ │ ├── pages
│ │ └── show.html
│ │ ├── posts
│ │ ├── index.html
│ │ ├── search.html
│ │ └── show.html
│ │ └── stylesheet.css
└── tiny_mce
│ ├── langs
│ └── en.js
│ ├── license.txt
│ ├── plugins
│ ├── advhr
│ │ ├── css
│ │ │ └── advhr.css
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── js
│ │ │ └── rule.js
│ │ ├── langs
│ │ │ └── en_dlg.js
│ │ └── rule.htm
│ ├── advimage
│ │ ├── css
│ │ │ └── advimage.css
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── image.htm
│ │ ├── img
│ │ │ └── sample.gif
│ │ ├── js
│ │ │ └── image.js
│ │ └── langs
│ │ │ └── en_dlg.js
│ ├── advlink
│ │ ├── css
│ │ │ └── advlink.css
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── js
│ │ │ └── advlink.js
│ │ ├── langs
│ │ │ └── en_dlg.js
│ │ └── link.htm
│ ├── advlist
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── autoresize
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── autosave
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ └── langs
│ │ │ └── en.js
│ ├── bbcode
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── contextmenu
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── directionality
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── emotions
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── emotions.htm
│ │ ├── img
│ │ │ ├── smiley-cool.gif
│ │ │ ├── smiley-cry.gif
│ │ │ ├── smiley-embarassed.gif
│ │ │ ├── smiley-foot-in-mouth.gif
│ │ │ ├── smiley-frown.gif
│ │ │ ├── smiley-innocent.gif
│ │ │ ├── smiley-kiss.gif
│ │ │ ├── smiley-laughing.gif
│ │ │ ├── smiley-money-mouth.gif
│ │ │ ├── smiley-sealed.gif
│ │ │ ├── smiley-smile.gif
│ │ │ ├── smiley-surprised.gif
│ │ │ ├── smiley-tongue-out.gif
│ │ │ ├── smiley-undecided.gif
│ │ │ ├── smiley-wink.gif
│ │ │ └── smiley-yell.gif
│ │ ├── js
│ │ │ └── emotions.js
│ │ └── langs
│ │ │ └── en_dlg.js
│ ├── example
│ │ ├── dialog.htm
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── img
│ │ │ └── example.gif
│ │ ├── js
│ │ │ └── dialog.js
│ │ └── langs
│ │ │ ├── en.js
│ │ │ └── en_dlg.js
│ ├── fullpage
│ │ ├── css
│ │ │ └── fullpage.css
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── fullpage.htm
│ │ ├── js
│ │ │ └── fullpage.js
│ │ └── langs
│ │ │ └── en_dlg.js
│ ├── fullscreen
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ └── fullscreen.htm
│ ├── iespell
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── inlinepopups
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── skins
│ │ │ └── clearlooks2
│ │ │ │ ├── img
│ │ │ │ ├── alert.gif
│ │ │ │ ├── button.gif
│ │ │ │ ├── buttons.gif
│ │ │ │ ├── confirm.gif
│ │ │ │ ├── corners.gif
│ │ │ │ ├── horizontal.gif
│ │ │ │ └── vertical.gif
│ │ │ │ └── window.css
│ │ └── template.htm
│ ├── insertdatetime
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── layer
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── legacyoutput
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── media
│ │ ├── css
│ │ │ ├── content.css
│ │ │ └── media.css
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── img
│ │ │ ├── flash.gif
│ │ │ ├── flv_player.swf
│ │ │ ├── quicktime.gif
│ │ │ ├── realmedia.gif
│ │ │ ├── shockwave.gif
│ │ │ ├── trans.gif
│ │ │ └── windowsmedia.gif
│ │ ├── js
│ │ │ ├── embed.js
│ │ │ └── media.js
│ │ ├── langs
│ │ │ └── en_dlg.js
│ │ └── media.htm
│ ├── nonbreaking
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── noneditable
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── pagebreak
│ │ ├── css
│ │ │ └── content.css
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ └── img
│ │ │ ├── pagebreak.gif
│ │ │ └── trans.gif
│ ├── paste
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── js
│ │ │ ├── pastetext.js
│ │ │ └── pasteword.js
│ │ ├── langs
│ │ │ └── en_dlg.js
│ │ ├── pastetext.htm
│ │ └── pasteword.htm
│ ├── preview
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── example.html
│ │ ├── jscripts
│ │ │ └── embed.js
│ │ └── preview.html
│ ├── print
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── save
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── searchreplace
│ │ ├── css
│ │ │ └── searchreplace.css
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── js
│ │ │ └── searchreplace.js
│ │ ├── langs
│ │ │ └── en_dlg.js
│ │ └── searchreplace.htm
│ ├── spellchecker
│ │ ├── css
│ │ │ └── content.css
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ └── img
│ │ │ └── wline.gif
│ ├── style
│ │ ├── css
│ │ │ └── props.css
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── js
│ │ │ └── props.js
│ │ ├── langs
│ │ │ └── en_dlg.js
│ │ └── props.htm
│ ├── tabfocus
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── table
│ │ ├── cell.htm
│ │ ├── css
│ │ │ ├── cell.css
│ │ │ ├── row.css
│ │ │ └── table.css
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── js
│ │ │ ├── cell.js
│ │ │ ├── merge_cells.js
│ │ │ ├── row.js
│ │ │ └── table.js
│ │ ├── langs
│ │ │ └── en_dlg.js
│ │ ├── merge_cells.htm
│ │ ├── row.htm
│ │ └── table.htm
│ ├── template
│ │ ├── blank.htm
│ │ ├── css
│ │ │ └── template.css
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── js
│ │ │ └── template.js
│ │ ├── langs
│ │ │ └── en_dlg.js
│ │ └── template.htm
│ ├── visualchars
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ ├── wordcount
│ │ ├── editor_plugin.js
│ │ └── editor_plugin_src.js
│ └── xhtmlxtras
│ │ ├── abbr.htm
│ │ ├── acronym.htm
│ │ ├── attributes.htm
│ │ ├── cite.htm
│ │ ├── css
│ │ ├── attributes.css
│ │ └── popup.css
│ │ ├── del.htm
│ │ ├── editor_plugin.js
│ │ ├── editor_plugin_src.js
│ │ ├── ins.htm
│ │ ├── js
│ │ ├── abbr.js
│ │ ├── acronym.js
│ │ ├── attributes.js
│ │ ├── cite.js
│ │ ├── del.js
│ │ ├── element_common.js
│ │ └── ins.js
│ │ └── langs
│ │ └── en_dlg.js
│ ├── themes
│ ├── advanced
│ │ ├── about.htm
│ │ ├── anchor.htm
│ │ ├── charmap.htm
│ │ ├── color_picker.htm
│ │ ├── editor_template.js
│ │ ├── editor_template_src.js
│ │ ├── image.htm
│ │ ├── img
│ │ │ ├── colorpicker.jpg
│ │ │ └── icons.gif
│ │ ├── js
│ │ │ ├── about.js
│ │ │ ├── anchor.js
│ │ │ ├── charmap.js
│ │ │ ├── color_picker.js
│ │ │ ├── image.js
│ │ │ ├── link.js
│ │ │ └── source_editor.js
│ │ ├── langs
│ │ │ ├── en.js
│ │ │ └── en_dlg.js
│ │ ├── link.htm
│ │ ├── skins
│ │ │ ├── default
│ │ │ │ ├── content.css
│ │ │ │ ├── dialog.css
│ │ │ │ ├── img
│ │ │ │ │ ├── buttons.png
│ │ │ │ │ ├── items.gif
│ │ │ │ │ ├── menu_arrow.gif
│ │ │ │ │ ├── menu_check.gif
│ │ │ │ │ ├── progress.gif
│ │ │ │ │ └── tabs.gif
│ │ │ │ └── ui.css
│ │ │ └── o2k7
│ │ │ │ ├── content.css
│ │ │ │ ├── dialog.css
│ │ │ │ ├── img
│ │ │ │ ├── button_bg.png
│ │ │ │ ├── button_bg_black.png
│ │ │ │ └── button_bg_silver.png
│ │ │ │ ├── ui.css
│ │ │ │ ├── ui_black.css
│ │ │ │ └── ui_silver.css
│ │ └── source_editor.htm
│ └── simple
│ │ ├── editor_template.js
│ │ ├── editor_template_src.js
│ │ ├── img
│ │ └── icons.gif
│ │ ├── langs
│ │ └── en.js
│ │ └── skins
│ │ ├── default
│ │ ├── content.css
│ │ └── ui.css
│ │ └── o2k7
│ │ ├── content.css
│ │ ├── img
│ │ └── button_bg.png
│ │ └── ui.css
│ ├── tiny_mce.js
│ ├── tiny_mce_popup.js
│ ├── tiny_mce_src.js
│ └── utils
│ ├── editable_selects.js
│ ├── form_utils.js
│ ├── mctabs.js
│ └── validate.js
├── servers
├── cluster_config.json
├── cluster_server.js
└── server.js
└── views
├── admin
├── comments
│ └── index.ejs
├── login.ejs
├── not_allowed.ejs
├── pages
│ ├── edit.ejs
│ ├── index.ejs
│ └── new.ejs
├── panel.ejs
├── plugins
│ └── index.ejs
├── posts
│ ├── edit.ejs
│ ├── import.ejs
│ ├── index.ejs
│ └── new.ejs
├── settings
│ └── index.ejs
├── template
│ └── index.ejs
└── users
│ ├── index.ejs
│ └── new.ejs
├── layout.ejs
├── pages
└── show.ejs
└── posts
├── index.ejs
├── search.ejs
└── show.ejs
/README.markdown:
--------------------------------------------------------------------------------
1 | Blogode
2 | =======
3 | Robust blog engine written in Node.js using MySQL Database
4 |
5 | Dependencies
6 | ------------
7 | * npm install mysql
8 | * npm install express
9 | * npm install ejs
10 | * npm install faye
11 |
12 | TODO
13 | ----
14 | * Refactor with Tests
15 | * Add other databases
16 | * Cluster data balance
17 | * Wordpress: import tags too.
18 | * Check for what plugins we should run for the request
19 | * Enable/disable plugins
20 | * Make everything RESTful
21 | * Implement other plugin actions
22 | * Javascript confirmation for destroy actions
23 | * Implement permission "can just edit his own posts".
24 | * Implement initial configuration interface
25 | * Implement posts sharing for social networks (Twitter and Facebook)
26 | * Implement statistics
27 |
28 | License:
29 | --------
30 |
31 | (The MIT License)
32 |
33 | Permission is hereby granted, free of charge, to any person obtaining
34 | a copy of this software and associated documentation files (the
35 | 'Software'), to deal in the Software without restriction, including
36 | without limitation the rights to use, copy, modify, merge, publish,
37 | distribute, sublicense, and/or sell copies of the Software, and to
38 | permit persons to whom the Software is furnished to do so, subject to
39 | the following conditions:
40 |
41 | The above copyright notice and this permission notice shall be
42 | included in all copies or substantial portions of the Software.
43 |
44 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
45 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
46 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
47 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
48 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
49 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
50 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
51 |
--------------------------------------------------------------------------------
/blogode.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/node
2 |
3 | var server = require("./servers/server.js");
4 | var clusterServer = require("./servers/cluster_server.js");
5 |
6 | var args = new Array();
7 |
8 | for(var i = 0; i < process.argv.length; i++) {
9 | if(process.argv[i].indexOf("/") < 0 && process.argv[i].indexOf("node") < 0) {
10 | args.push(process.argv[i]);
11 | }
12 | }
13 |
14 | if(args[0] == "server") {
15 | var port = 3000;
16 | var clusterArg = 1;
17 |
18 | if(!isNaN(parseInt(args[1])) && parseInt(args[1]) > 0) {
19 | port = parseInt(args[1]);
20 | clusterArg = 2;
21 | }
22 |
23 | var clusterAddress = "";
24 | var clusterPort = 0;
25 |
26 | if(args[clusterArg] == "cluster") {
27 | var addr = args[clusterArg+1]
28 | if(addr != undefined) {
29 | if(addr.indexOf(":") >= 0) {
30 | var separator = addr.split(":");
31 | if(isNaN(parseInt(separator[1]))) {
32 | console.log('Invalid cluster port.')
33 | } else {
34 | clusterAddress = separator[0];
35 | clusterPort = parseInt(separator[1]);
36 | }
37 | } else {
38 | clusterAddress = addr;
39 | clusterPort = 6108; // default port
40 | }
41 | } else {
42 | console.log("Invalid cluster server address")
43 | process.exit(-1);
44 | }
45 | }
46 |
47 | var socketPort = 6108;
48 |
49 | if(!isNaN(parseInt(args[clusterArg+2]))) {
50 | socketPort = parseInt(args[clusterArg+2]);
51 | } else {
52 | if(args[clusterArg+2]) {
53 | console.log('Invalid cluster server socket port.')
54 | process.exit(-1);
55 | }
56 | }
57 |
58 |
59 | // exports.startServer = function(serverPort, clusterServerIp, clusterServerPort, clusterSocketPort) {
60 |
61 | server.startServer(port, clusterAddress, clusterPort, socketPort);
62 | } else if(args[0] == "cluster") {
63 | var port = 8080;
64 |
65 | if(!isNaN(parseInt(args[1])) && parseInt(args[1]) > 0) {
66 | port = parseInt(args[1]);
67 | } else if(args[1] != undefined) {
68 | console.log("Invalid port.");
69 | process.exit();
70 | }
71 |
72 | clusterServer.startClusterServer(port);
73 | } else if(args[0] == undefined) {
74 | console.log("Missing arguments.");
75 | process.exit();
76 | } else {
77 | console.log("Invalid argument.");
78 | process.exit();
79 | }
--------------------------------------------------------------------------------
/config/blog.json:
--------------------------------------------------------------------------------
1 | {"current_template":"pedrofranceschi.com","blog_name":"Blogode","blog_address":"http://0.0.0.0:3000/","blog_description":"A Lorem Ipsum Blog!","blog_posts_per_page":"2","index_page":"0"}
--------------------------------------------------------------------------------
/config/database.json:
--------------------------------------------------------------------------------
1 | {
2 | "hostname": "localhost",
3 | "username": "blogode",
4 | "password": "blogode",
5 | "database": "blogode"
6 | }
--------------------------------------------------------------------------------
/config/plugins.json:
--------------------------------------------------------------------------------
1 | {"twitter_search":{"search_term":"#geekJoke"},"user_tweets":{"username":"pedroh96"}}
--------------------------------------------------------------------------------
/controllers/pages.js:
--------------------------------------------------------------------------------
1 | var config = require ("../lib/config");
2 | var postsController = require("./posts.js")
3 | var pages = require("../lib/pages.js");
4 |
5 | var pagesCache;
6 |
7 | exports.updatePagesCache = function() {
8 | pages.getPages(function(pages){
9 | global.pagesCache = pages;
10 | });
11 | }
12 |
13 | exports.getPagesCache = function() {
14 | return global.pagesCache;
15 | }
16 |
17 | // exports.index = function(req, res) {
18 | // // TODO: cache current page to avoid disk I/O.
19 | // config.getBlogConfigKeyValue('index_page', function(page){
20 | // if(page == '0') {
21 | // postsController.index(req, res);
22 | // } else {
23 | //
24 | // }
25 | // });
26 | // }
27 |
28 | exports.showPage = function(req, res) {
29 | if(!req.param('name')) {
30 | return res.send("A page ID is needed.")
31 | }
32 |
33 | pages.getPageByLinkName(req.param('name'), function(page){
34 | req.events.on('pluginsAreLoaded', function() {
35 | res.render('pages/show', {
36 | locals: { 'page': page }
37 | });
38 | });
39 | });
40 | }
--------------------------------------------------------------------------------
/filters/admin.js:
--------------------------------------------------------------------------------
1 | var sys = require("sys");
2 |
3 | exports.verifyLogin = function (req, res, next) {
4 | // verifies if user is an admin
5 |
6 | if(!req.session.username) {
7 | return res.redirect("/admin/login");
8 | }
9 | next();
10 | };
11 |
12 | exports.verifyPostPermission = function (req, res, next) {
13 | // verifies if user have permission to manage posts
14 |
15 | if(req.session.user_permission.toString().indexOf("1") < 0) {
16 | return res.redirect("/admin/not_allowed");
17 | }
18 | next();
19 | };
20 |
21 | exports.verifyCommentPermission = function (req, res, next) {
22 | // verifies if user have permission to manage comments
23 |
24 | if(req.session.user_permission.toString().indexOf("2") < 0) {
25 | return res.redirect("/admin/not_allowed");
26 | }
27 | next();
28 | };
29 |
30 | exports.verifyPagePermission = function (req, res, next) {
31 | // verifies if user have permission to manage pages
32 |
33 | if(req.session.user_permission.toString().indexOf("3") < 0) {
34 | return res.redirect("/admin/not_allowed");
35 | }
36 | next();
37 | };
38 |
39 | exports.verifyTemplatePermission = function (req, res, next) {
40 | // verifies if user have permission to manage templates
41 |
42 | if(req.session.user_permission.toString().indexOf("4") < 0) {
43 | return res.redirect("/admin/not_allowed");
44 | }
45 | next();
46 | };
47 |
48 | exports.verifyPluginPermission = function (req, res, next) {
49 | // verifies if user have permission to manage plugins
50 |
51 | if(req.session.user_permission.toString().indexOf("5") < 0) {
52 | return res.redirect("/admin/not_allowed");
53 | }
54 | next();
55 | };
56 |
57 | exports.verifySettingsPermission = function (req, res, next) {
58 | // verifies if user have permission to manage blog settings
59 |
60 | if(req.session.user_permission.toString().indexOf("6") < 0) {
61 | return res.redirect("/admin/not_allowed");
62 | }
63 | next();
64 | };
65 |
66 | exports.verifyUsersPermission = function (req, res, next) {
67 | // verifies if user have permission to manage users
68 |
69 | if(req.session.user_permission.toString().indexOf("7") < 0) {
70 | return res.redirect("/admin/not_allowed");
71 | }
72 | next();
73 | };
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # install stuff to build node
4 | apt-get install build-essential libssl-dev python libssl-dev curl;
5 |
6 | # download and compile node
7 | cd /tmp
8 | wget "http://nodejs.org/dist/node-v0.2.5.tar.gz"
9 | tar xzvf node-v0.2.5.tar.gz
10 | cd node-v0.2.5
11 | ./configure
12 | make
13 | make install
14 |
15 | # install npm (node package manager)
16 | curl http://npmjs.org/install.sh | sh
17 |
18 | # install blogode
19 | mkdir /var/
20 | cd /var/
21 | wget "http://download.github.com/pedrofranceschi-Blogode-e3992af.zip"
22 | unzip pedrofranceschi-Blogode-*.zip
23 | rm *.zip
24 | mv pedrofranceschi-Blogode-* blogode/
25 | cd blogode
26 |
27 | # install all dependencies
28 | npm install ejs express faye step mysql forever
29 |
30 | # sets the default start script for blogode
31 | echo "#!/bin/sh\ncd /var/blogode/ && forever start blogode.js" > /usr/bin/start_blogode
32 | chmod +x /usr/bin/start_blogode
--------------------------------------------------------------------------------
/lib/comments.js:
--------------------------------------------------------------------------------
1 | var sys = require('sys'),
2 | database = require('./database.js');
3 |
4 | exports.getComments = function(sinceId, limitNumber, callback) {
5 | var limitString = "";
6 |
7 | if(limitNumber != 0) {
8 | limitString = "LIMIT " + limitNumber;
9 | }
10 |
11 | database.getDatabaseConnection(function (mysql_client) {
12 | mysql_client.query("SELECT * FROM comments WHERE id > '" + escape(sinceId) + "' ORDER BY id ASC " + limitString + ";", function (error, results, fields) {
13 | if(error) {
14 | throw "Error getting comment: " + error;
15 | }
16 | callback(results);
17 | });
18 | });
19 | }
20 |
21 |
22 | exports.getCommentsOfPost = function(postId, callback) {
23 | database.getDatabaseConnection(function (mysql_client) {
24 | mysql_client.query("SELECT * FROM comments WHERE post_id='" + escape(postId) + "' ORDER BY id ASC;", function (error, results, fields) {
25 | if(error) {
26 | throw "Error getting comment: " + error;
27 | }
28 | var comments = new Array();
29 | for(var i = 0; i < results.length; i++) {
30 | var thisComment = results[i]
31 | thisComment.created_at = sys.inspect(thisComment.created_at)
32 | comments.push(thisComment);
33 | }
34 |
35 | callback(comments);
36 | });
37 | });
38 | }
39 |
40 | exports.saveComment = function(postId, authorName, authorEmail, comment, callback) {
41 | database.getDatabaseConnection(function (mysql_client) {
42 | mysql_client.query("INSERT INTO comments (post_id, author_name, author_email, comment) VALUES ('" + escape(postId) + "', '" + escape(authorName) + "', '" + escape(authorEmail) + "', '" + escape(comment) + "'); SELECT * FROM comments WHERE id=LAST_INSERT_ID();", function (error, results, fields) {
43 | if(error) {
44 | throw "Error inserting comment: " + error;
45 | }
46 | setTimeout(function(){
47 | mysql_client.query("SELECT * FROM comments WHERE id=" + results.insertId + ";", function (error_, results_, fields) {
48 | if(error_) {
49 | throw "Error inserting comment: " + error_;
50 | }
51 | callback(results_[0]);
52 | });
53 | }, 50);
54 | });
55 | });
56 | }
57 |
58 | exports.destroyComment = function(commentId, callback) {
59 | database.getDatabaseConnection(function (mysql_client) {
60 | mysql_client.query("DELETE FROM comments WHERE id='" + escape(commentId) + "'", function (error, results, fields) {
61 | if(error) {
62 | throw "Error inserting comment: " + error;
63 | }
64 | callback();
65 | });
66 | });
67 | }
--------------------------------------------------------------------------------
/lib/config.js:
--------------------------------------------------------------------------------
1 | var sys = require('sys');
2 | var fs = require('fs');
3 |
4 | exports.getBlogConfigKeyValue = function(key, callback) {
5 | fs.readFile('./config/blog.json', function(err, content) {
6 | if(err) {
7 | throw err;
8 | } else {
9 | var configParser = JSON.parse(content);
10 | callback(configParser[key]);
11 | }
12 | });
13 | }
14 |
15 | exports.getAllBlogConfigKeyValues = function(callback) {
16 | fs.readFile('./config/blog.json', function(err, content) {
17 | if(err) {
18 | throw err;
19 | } else {
20 | var configParser = JSON.parse(content);
21 | callback(configParser);
22 | }
23 | });
24 | }
25 |
26 | exports.setBlogConfigKeyValue = function(key, value, callback) {
27 | fs.readFile('./config/blog.json', function(err, content) {
28 | if(err) {
29 | throw err;
30 | } else {
31 | var configParser = JSON.parse(content);
32 | configParser[key] = value;
33 |
34 | fs.writeFile('./config/blog.json', JSON.stringify(configParser), function (err) {
35 | if (err) throw err;
36 | callback();
37 | });
38 | }
39 | });
40 | }
41 |
42 | exports.setAllBlogConfigKeyValues = function(keyAndValues, callback) {
43 | fs.writeFile('./config/blog.json', JSON.stringify(keyAndValues), function (err) {
44 | if (err) throw err;
45 | callback();
46 | });
47 | }
--------------------------------------------------------------------------------
/lib/database.js:
--------------------------------------------------------------------------------
1 | var sys = require('sys'),
2 | fs = require('fs'),
3 | Client = require('mysql').Client;
4 |
5 | var client = new Client();
6 |
7 | exports.close = function() {
8 | client.end();
9 | }
10 |
11 | exports.reconnect = function() {
12 | exports.initialize(function(){});
13 | }
14 |
15 | exports.initialize = function(callback) {
16 | this._getDatabaseSettingsFromConfig(function (hostname, username, password, database){
17 | client.user = username;
18 | client.password = password;
19 | client.host = hostname;
20 | client.connect();
21 | client.query('USE ' + escape(database));
22 |
23 | exports._createTables(client, function(){});
24 | callback(client);
25 | });
26 | }
27 |
28 | exports.getDatabaseConnection = function(callback) {
29 | if(client.connected == false) {
30 | exports.initialize(function(){
31 | callback(client);
32 | });
33 | } else {
34 | callback(client);
35 | }
36 | }
37 |
38 | exports._createTables = function(mysql_client, callback) {
39 | mysql_client.query("CREATE TABLE IF NOT EXISTS posts (id INT PRIMARY KEY AUTO_INCREMENT, user_id INT, title VARCHAR(200), body TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);")
40 | mysql_client.query("CREATE TABLE IF NOT EXISTS pages (id INT PRIMARY KEY AUTO_INCREMENT, user_id INT, title VARCHAR(200), link_name VARCHAR(200), body TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);")
41 | mysql_client.query("CREATE TABLE IF NOT EXISTS users (id INT PRIMARY KEY AUTO_INCREMENT, permission_level INT, name VARCHAR(100), description VARCHAR(500), email VARCHAR(100), username VARCHAR(100), password VARCHAR(100), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);")
42 | mysql_client.query("CREATE TABLE IF NOT EXISTS comments (id INT PRIMARY KEY AUTO_INCREMENT, post_id INT, author_name VARCHAR(100), author_email VARCHAR(100), comment TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP);")
43 | mysql_client.query("CREATE TABLE IF NOT EXISTS post_tags (post_id INT, tag VARCHAR(100));")
44 | callback();
45 | }
46 |
47 | exports._getDatabaseSettingsFromConfig = function(callback) {
48 | fs.readFile('./config/database.json', function(err, content) {
49 | var parser = JSON.parse(content);
50 | callback(parser['hostname'], parser['username'], parser['password'], parser['database'])
51 | });
52 | }
--------------------------------------------------------------------------------
/lib/helper.js:
--------------------------------------------------------------------------------
1 | var sys = require("sys");
2 | var ejs = require("ejs");
3 | var fs = require("fs");
4 |
5 | exports.renderView = function(plugin, view, viewVariables, callback){
6 | fs.readFile('./plugins/' + plugin.pluginInfos["call_name"] + '/' + view, function(err, file_content) {
7 | if(err) sys.puts(err);
8 |
9 | callback(ejs.render(file_content.toString(), { locals: viewVariables }))
10 | });
11 | }
12 |
13 | exports.getConfigVariableValue = function(plugin, variableName, callback){
14 | fs.readFile('./config/plugins.json', function(err, content){
15 | if(err) throw err;
16 | var parser = JSON.parse(content);
17 | if(parser[plugin.pluginInfos.call_name] == undefined) {
18 | callback(undefined);
19 | } else {
20 | callback(parser[plugin.pluginInfos.call_name][variableName]);
21 | }
22 | });
23 | }
--------------------------------------------------------------------------------
/lib/plugins.js:
--------------------------------------------------------------------------------
1 | var sys = require("sys");
2 | var fs = require("fs");
3 |
4 | exports.setPluginConfigValues = function(pluginName, values, callback) {
5 | fs.readFile('./config/plugins.json', function(err, content){
6 | if(err) throw err;
7 | var parser = JSON.parse(content);
8 | parser[pluginName] = values;
9 | fs.writeFile('./config/plugins.json', JSON.stringify(parser), function (err) {
10 | if(err) throw err;
11 | callback();
12 | });
13 | });
14 | }
15 |
16 | exports.getPluginConfigValues = function(callback) {
17 | fs.readFile('./config/plugins.json', function(err, content){
18 | if(err) throw err;
19 | var parser = JSON.parse(content);
20 | callback(parser);
21 | });
22 | }
23 |
24 | exports.getPluginConfigValues = function(callback) {
25 | fs.readFile('./config/plugins.json', function(err, content){
26 | if(err) throw err;
27 | var parser = JSON.parse(content);
28 | callback(parser);
29 | });
30 | }
--------------------------------------------------------------------------------
/lib/tags.js:
--------------------------------------------------------------------------------
1 | var sys = require('sys'),
2 | database = require('./database.js'),
3 | posts = require('./posts.js')
4 |
5 | exports.getAllTags = function(callback) {
6 | database.getDatabaseConnection(function (mysql_client) {
7 | mysql_client.query("SELECT * FROM post_tags;", function (error, results, fields) {
8 | if(error) {
9 | throw "Error getting tags: " + error;
10 | }
11 | var tags = {};
12 |
13 | for(var i=0; i < results.length; i++) {
14 | if(tags[results[i].tag] == undefined) {
15 | tags[results[i].tag] = 1;
16 | } else {
17 | tags[results[i].tag] += 1;
18 | }
19 | };
20 |
21 | callback(tags);
22 | });
23 | });
24 | }
25 |
26 |
27 | exports.getPostsWithTag = function(tag, callback) {
28 | database.getDatabaseConnection(function (mysql_client) {
29 | mysql_client.query("SELECT * FROM post_tags WHERE tag='" + escape(tag) + "';", function (error, results, fields) {
30 | if(error) {
31 | throw "Error getting post tags: " + error;
32 | }
33 |
34 | var postsArr = new Array();
35 | var postsToGet = new Array();
36 |
37 | for(var i=0; i < results.length; i++) {
38 | postsToGet.push(results[i].post_id);
39 | }
40 |
41 | function getNextPostData() {
42 | if(postsToGet.length == 0) {
43 | callback(postsArr);
44 | } else {
45 | posts.getPost(postsToGet[0], function(postData){
46 | postsToGet.splice(0, 1);
47 | postsArr.push(postData);
48 | getNextPostData();
49 | });
50 | }
51 | }
52 |
53 | getNextPostData();
54 | });
55 | });
56 | }
57 |
58 | exports.createTagsForPost = function(post_id, tags, callback) {
59 | database.getDatabaseConnection(function (mysql_client) {
60 | for(var i=0; i < tags.length; i++) {
61 | mysql_client.query("INSERT INTO post_tags (post_id, tag) VALUES ('" + escape(post_id) + "', '" + escape(tags[i]) + "');");
62 | }
63 | setTimeout(function(){
64 | callback();
65 | }, 100);
66 | });
67 | }
68 |
69 | exports.deletePostTags = function(post_id, callback) {
70 | database.getDatabaseConnection(function (mysql_client) {
71 | mysql_client.query("DELETE FROM post_tags WHERE post_id='" + escape(post_id) + "';", function (error, results, fields) {
72 | if(error) {
73 | throw "Error deleting post's tags: " + error;
74 | }
75 | callback();
76 | });
77 | });
78 | }
--------------------------------------------------------------------------------
/plugins/twitter_search/view.html:
--------------------------------------------------------------------------------
1 |
Twitter Search
2 | Recent tweets with '<%= hashtag %>'
3 |
4 | <% for(var i=0; i < data.length; i++) { %>
5 | @<%= data[i]["from_user"] %>: <%= data[i]["text"] %>
6 | <% } %>
7 |
--------------------------------------------------------------------------------
/plugins/user_tweets/view.html:
--------------------------------------------------------------------------------
1 | <%
2 |
3 | function relative_time(time_value) {
4 | var values = time_value.split(" ");
5 | time_value = values[1] + " " + values[2] + ", " + values[5] + " " + values[3];
6 | var parsed_date = Date.parse(time_value);
7 | var relative_to = (arguments.length > 1) ? arguments[1] : new Date();
8 | var delta = parseInt((relative_to.getTime() - parsed_date) / 1000);
9 | delta = delta + (relative_to.getTimezoneOffset() * 60);
10 |
11 | if (delta < 60) {
12 | return 'less than a minute ago';
13 | } else if(delta < 120) {
14 | return 'about a minute ago';
15 | } else if(delta < (60*60)) {
16 | return (parseInt(delta / 60)).toString() + ' minutes ago';
17 | } else if(delta < (120*60)) {
18 | return 'about an hour ago';
19 | } else if(delta < (24*60*60)) {
20 | return 'about ' + (parseInt(delta / 3600)).toString() + ' hours ago';
21 | } else if(delta < (48*60*60)) {
22 | return '1 day ago';
23 | } else {
24 | return (parseInt(delta / 86400)).toString() + ' days ago';
25 | }
26 | }
27 |
28 | %>
29 |
30 | Twitter
31 |
32 | <% if(data != undefined) { %>
33 | <% for(var i=0; i < data.length; i++) { %>
34 |
35 | <%= data[i]["text"] %> <%= relative_time (data[i].created_at) %>
36 |
37 | <% } %>
38 |
39 | Follow <%= username %> on Twitter!
40 | <% } %>
--------------------------------------------------------------------------------
/public/templates/default_theme/info.json:
--------------------------------------------------------------------------------
1 | {
2 | "template_name": "Blogode's Default Template.",
3 | "author_name": "Pedro Franceschi",
4 | "author_email": "pedrohfranceschi@gmail.com",
5 | "version": "0.1"
6 | }
--------------------------------------------------------------------------------
/public/templates/default_theme/layout.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | <%= blogName %>
4 |
5 |
6 |
7 |
8 |
9 | HEADER
10 |
14 |
15 | <%- body %>
16 |
17 | FOOTER
18 |
19 |
--------------------------------------------------------------------------------
/public/templates/default_theme/posts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | <% if(posts != undefined) { %>
4 | <% for (var i=0; i < posts.length; i++) { %>
5 |
6 | by <%= posts[i].user_name %>
7 | <% if(unescape(posts[i].body).indexOf("###") >= 0) { %>
8 | <%- unescape(posts[i].body).split("###")[0] %>
9 | <% } else { %>
10 | <%- unescape(posts[i].body) %>
11 | <% } %>
12 | <% } %>
13 | <% } %>
--------------------------------------------------------------------------------
/public/templates/default_theme/posts/show.html:
--------------------------------------------------------------------------------
1 |
28 |
29 | <%= unescape(post.title) %>
30 | by <%= post.user_name %>
31 | <%- unescape(post.body) %>
32 |
33 |
34 | Comments
35 |
36 |
44 |
45 |
46 | New comment
47 |
48 |
--------------------------------------------------------------------------------
/public/templates/default_theme/stylesheet.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #FFFFFF;
3 | }
--------------------------------------------------------------------------------
/public/templates/initial_theme/info.json:
--------------------------------------------------------------------------------
1 | {
2 | "template_name": "Blogode's Initial Template.",
3 | "author_name": "Pedro Franceschi",
4 | "author_email": "pedrohfranceschi@gmail.com",
5 | "version": "0.1"
6 | }
--------------------------------------------------------------------------------
/public/templates/initial_theme/posts/search.html:
--------------------------------------------------------------------------------
1 | Search results (from theme)
2 |
3 | <% if(posts != undefined) { %>
4 | <% for (var i=0; i < posts.length; i++) { %>
5 |
6 | by <%= posts[i].user_name %>
7 | <% if(unescape(posts[i].body).indexOf("###") >= 0) { %>
8 | <%- unescape(posts[i].body).split("###")[0] %>
9 | <% } else { %>
10 | <%- unescape(posts[i].body) %>
11 | <% } %>
12 | <% } %>
13 | <% } %>
--------------------------------------------------------------------------------
/public/templates/initial_theme/stylesheet.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #FFFFFF;
3 | }
--------------------------------------------------------------------------------
/public/templates/my_other_theme/info.json:
--------------------------------------------------------------------------------
1 | {
2 | "template_name": "Blogode's Test Template.",
3 | "author_name": "Pedro Franceschi",
4 | "author_email": "pedrohfranceschi@gmail.com",
5 | "version": "0.1"
6 | }
--------------------------------------------------------------------------------
/public/templates/my_other_theme/posts/search.html:
--------------------------------------------------------------------------------
1 | Search results (from theme)
2 |
3 | <% if(posts != undefined) { %>
4 | <% for (var i=0; i < posts.length; i++) { %>
5 |
6 | by <%= posts[i].user_name %>
7 | <% if(unescape(posts[i].body).indexOf("###") >= 0) { %>
8 | <%- unescape(posts[i].body).split("###")[0] %>
9 | <% } else { %>
10 | <%- unescape(posts[i].body) %>
11 | <% } %>
12 | <% } %>
13 | <% } %>
--------------------------------------------------------------------------------
/public/templates/my_other_theme/stylesheet.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #FFFFFF;
3 | }
--------------------------------------------------------------------------------
/public/templates/pedrofranceschi.com/info.json:
--------------------------------------------------------------------------------
1 | {
2 | "template_name": "pedrofranceschi.com's theme",
3 | "author_name": "Pedro Franceschi",
4 | "author_email": "pedrohfranceschi@gmail.com",
5 | "version": "0.1"
6 | }
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advhr/css/advhr.css:
--------------------------------------------------------------------------------
1 | input.radio {border:1px none #000; background:transparent; vertical-align:middle;}
2 | .panel_wrapper div.current {height:80px;}
3 | #width {width:50px; vertical-align:middle;}
4 | #width2 {width:50px; vertical-align:middle;}
5 | #size {width:100px;}
6 |
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advhr/editor_plugin.js:
--------------------------------------------------------------------------------
1 | (function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})();
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advhr/editor_plugin_src.js:
--------------------------------------------------------------------------------
1 | /**
2 | * editor_plugin_src.js
3 | *
4 | * Copyright 2009, Moxiecode Systems AB
5 | * Released under LGPL License.
6 | *
7 | * License: http://tinymce.moxiecode.com/license
8 | * Contributing: http://tinymce.moxiecode.com/contributing
9 | */
10 |
11 | (function() {
12 | tinymce.create('tinymce.plugins.AdvancedHRPlugin', {
13 | init : function(ed, url) {
14 | // Register commands
15 | ed.addCommand('mceAdvancedHr', function() {
16 | ed.windowManager.open({
17 | file : url + '/rule.htm',
18 | width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)),
19 | height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)),
20 | inline : 1
21 | }, {
22 | plugin_url : url
23 | });
24 | });
25 |
26 | // Register buttons
27 | ed.addButton('advhr', {
28 | title : 'advhr.advhr_desc',
29 | cmd : 'mceAdvancedHr'
30 | });
31 |
32 | ed.onNodeChange.add(function(ed, cm, n) {
33 | cm.setActive('advhr', n.nodeName == 'HR');
34 | });
35 |
36 | ed.onClick.add(function(ed, e) {
37 | e = e.target;
38 |
39 | if (e.nodeName === 'HR')
40 | ed.selection.select(e);
41 | });
42 | },
43 |
44 | getInfo : function() {
45 | return {
46 | longname : 'Advanced HR',
47 | author : 'Moxiecode Systems AB',
48 | authorurl : 'http://tinymce.moxiecode.com',
49 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
50 | version : tinymce.majorVersion + "." + tinymce.minorVersion
51 | };
52 | }
53 | });
54 |
55 | // Register plugin
56 | tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin);
57 | })();
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advhr/js/rule.js:
--------------------------------------------------------------------------------
1 | var AdvHRDialog = {
2 | init : function(ed) {
3 | var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w;
4 |
5 | w = dom.getAttrib(n, 'width');
6 | f.width.value = w ? parseInt(w) : (dom.getStyle('width') || '');
7 | f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || '';
8 | f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width');
9 | selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px');
10 | },
11 |
12 | update : function() {
13 | var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = '';
14 |
15 | h = '
';
36 |
37 | ed.execCommand("mceInsertContent", false, h);
38 | tinyMCEPopup.close();
39 | }
40 | };
41 |
42 | tinyMCEPopup.requireLangPack();
43 | tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);
44 |
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advhr/langs/en_dlg.js:
--------------------------------------------------------------------------------
1 | tinyMCE.addI18n('en.advhr_dlg',{
2 | width:"Width",
3 | size:"Height",
4 | noshade:"No shadow"
5 | });
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advhr/rule.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {#advhr.advhr_desc}
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advimage/css/advimage.css:
--------------------------------------------------------------------------------
1 | #src_list, #over_list, #out_list {width:280px;}
2 | .mceActionPanel {margin-top:7px;}
3 | .alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
4 | .checkbox {border:0;}
5 | .panel_wrapper div.current {height:305px;}
6 | #prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
7 | #align, #classlist {width:150px;}
8 | #width, #height {vertical-align:middle; width:50px; text-align:center;}
9 | #vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
10 | #class_list {width:180px;}
11 | input {width: 280px;}
12 | #constrain, #onmousemovecheck {width:auto;}
13 | #id, #dir, #lang, #usemap, #longdesc {width:200px;}
14 |
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advimage/editor_plugin.js:
--------------------------------------------------------------------------------
1 | (function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})();
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advimage/editor_plugin_src.js:
--------------------------------------------------------------------------------
1 | /**
2 | * editor_plugin_src.js
3 | *
4 | * Copyright 2009, Moxiecode Systems AB
5 | * Released under LGPL License.
6 | *
7 | * License: http://tinymce.moxiecode.com/license
8 | * Contributing: http://tinymce.moxiecode.com/contributing
9 | */
10 |
11 | (function() {
12 | tinymce.create('tinymce.plugins.AdvancedImagePlugin', {
13 | init : function(ed, url) {
14 | // Register commands
15 | ed.addCommand('mceAdvImage', function() {
16 | // Internal image object like a flash placeholder
17 | if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)
18 | return;
19 |
20 | ed.windowManager.open({
21 | file : url + '/image.htm',
22 | width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
23 | height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
24 | inline : 1
25 | }, {
26 | plugin_url : url
27 | });
28 | });
29 |
30 | // Register buttons
31 | ed.addButton('image', {
32 | title : 'advimage.image_desc',
33 | cmd : 'mceAdvImage'
34 | });
35 | },
36 |
37 | getInfo : function() {
38 | return {
39 | longname : 'Advanced image',
40 | author : 'Moxiecode Systems AB',
41 | authorurl : 'http://tinymce.moxiecode.com',
42 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
43 | version : tinymce.majorVersion + "." + tinymce.minorVersion
44 | };
45 | }
46 | });
47 |
48 | // Register plugin
49 | tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
50 | })();
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advimage/img/sample.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/advimage/img/sample.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advimage/langs/en_dlg.js:
--------------------------------------------------------------------------------
1 | tinyMCE.addI18n('en.advimage_dlg',{
2 | tab_general:"General",
3 | tab_appearance:"Appearance",
4 | tab_advanced:"Advanced",
5 | general:"General",
6 | title:"Title",
7 | preview:"Preview",
8 | constrain_proportions:"Constrain proportions",
9 | langdir:"Language direction",
10 | langcode:"Language code",
11 | long_desc:"Long description link",
12 | style:"Style",
13 | classes:"Classes",
14 | ltr:"Left to right",
15 | rtl:"Right to left",
16 | id:"Id",
17 | map:"Image map",
18 | swap_image:"Swap image",
19 | alt_image:"Alternative image",
20 | mouseover:"for mouse over",
21 | mouseout:"for mouse out",
22 | misc:"Miscellaneous",
23 | example_img:"Appearance preview image",
24 | missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.",
25 | dialog_title:"Insert/edit image",
26 | src:"Image URL",
27 | alt:"Image description",
28 | list:"Image list",
29 | border:"Border",
30 | dimensions:"Dimensions",
31 | vspace:"Vertical space",
32 | hspace:"Horizontal space",
33 | align:"Alignment",
34 | align_baseline:"Baseline",
35 | align_top:"Top",
36 | align_middle:"Middle",
37 | align_bottom:"Bottom",
38 | align_texttop:"Text top",
39 | align_textbottom:"Text bottom",
40 | align_left:"Left",
41 | align_right:"Right",
42 | image_list:"Image list"
43 | });
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advlink/css/advlink.css:
--------------------------------------------------------------------------------
1 | .mceLinkList, .mceAnchorList, #targetlist {width:280px;}
2 | .mceActionPanel {margin-top:7px;}
3 | .panel_wrapper div.current {height:320px;}
4 | #classlist, #title, #href {width:280px;}
5 | #popupurl, #popupname {width:200px;}
6 | #popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
7 | #id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
8 | #events_panel input {width:200px;}
9 |
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advlink/editor_plugin.js:
--------------------------------------------------------------------------------
1 | (function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})();
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advlink/editor_plugin_src.js:
--------------------------------------------------------------------------------
1 | /**
2 | * editor_plugin_src.js
3 | *
4 | * Copyright 2009, Moxiecode Systems AB
5 | * Released under LGPL License.
6 | *
7 | * License: http://tinymce.moxiecode.com/license
8 | * Contributing: http://tinymce.moxiecode.com/contributing
9 | */
10 |
11 | (function() {
12 | tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {
13 | init : function(ed, url) {
14 | this.editor = ed;
15 |
16 | // Register commands
17 | ed.addCommand('mceAdvLink', function() {
18 | var se = ed.selection;
19 |
20 | // No selection and not in link
21 | if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
22 | return;
23 |
24 | ed.windowManager.open({
25 | file : url + '/link.htm',
26 | width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),
27 | height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),
28 | inline : 1
29 | }, {
30 | plugin_url : url
31 | });
32 | });
33 |
34 | // Register buttons
35 | ed.addButton('link', {
36 | title : 'advlink.link_desc',
37 | cmd : 'mceAdvLink'
38 | });
39 |
40 | ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');
41 |
42 | ed.onNodeChange.add(function(ed, cm, n, co) {
43 | cm.setDisabled('link', co && n.nodeName != 'A');
44 | cm.setActive('link', n.nodeName == 'A' && !n.name);
45 | });
46 | },
47 |
48 | getInfo : function() {
49 | return {
50 | longname : 'Advanced link',
51 | author : 'Moxiecode Systems AB',
52 | authorurl : 'http://tinymce.moxiecode.com',
53 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
54 | version : tinymce.majorVersion + "." + tinymce.minorVersion
55 | };
56 | }
57 | });
58 |
59 | // Register plugin
60 | tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);
61 | })();
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advlink/langs/en_dlg.js:
--------------------------------------------------------------------------------
1 | tinyMCE.addI18n('en.advlink_dlg',{
2 | title:"Insert/edit link",
3 | url:"Link URL",
4 | target:"Target",
5 | titlefield:"Title",
6 | is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
7 | is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",
8 | list:"Link list",
9 | general_tab:"General",
10 | popup_tab:"Popup",
11 | events_tab:"Events",
12 | advanced_tab:"Advanced",
13 | general_props:"General properties",
14 | popup_props:"Popup properties",
15 | event_props:"Events",
16 | advanced_props:"Advanced properties",
17 | popup_opts:"Options",
18 | anchor_names:"Anchors",
19 | target_same:"Open in this window / frame",
20 | target_parent:"Open in parent window / frame",
21 | target_top:"Open in top frame (replaces all frames)",
22 | target_blank:"Open in new window",
23 | popup:"Javascript popup",
24 | popup_url:"Popup URL",
25 | popup_name:"Window name",
26 | popup_return:"Insert 'return false'",
27 | popup_scrollbars:"Show scrollbars",
28 | popup_statusbar:"Show status bar",
29 | popup_toolbar:"Show toolbars",
30 | popup_menubar:"Show menu bar",
31 | popup_location:"Show location bar",
32 | popup_resizable:"Make window resizable",
33 | popup_dependent:"Dependent (Mozilla/Firefox only)",
34 | popup_size:"Size",
35 | popup_position:"Position (X/Y)",
36 | id:"Id",
37 | style:"Style",
38 | classes:"Classes",
39 | target_name:"Target name",
40 | langdir:"Language direction",
41 | target_langcode:"Target language",
42 | langcode:"Language code",
43 | encoding:"Target character encoding",
44 | mime:"Target MIME type",
45 | rel:"Relationship page to target",
46 | rev:"Relationship target to page",
47 | tabindex:"Tabindex",
48 | accesskey:"Accesskey",
49 | ltr:"Left to right",
50 | rtl:"Right to left",
51 | link_list:"Link list"
52 | });
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/advlist/editor_plugin.js:
--------------------------------------------------------------------------------
1 | (function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square")},createControl:function(d,b){var f=this,e,h;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){h=f[d][0]}function c(i,k){var j=true;a(k.styles,function(m,l){if(f.editor.dom.getStyle(i,l)!=m){j=false;return false}});return j}function g(){var k,i=f.editor,l=i.dom,j=i.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,h)){i.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(h){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,h.styles);k.removeAttribute("_mce_style")}}}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){g()}});e.onRenderMenu.add(function(i,j){j.onShowMenu.add(function(){var m=f.editor.dom,l=m.getParent(f.editor.selection.getNode(),"ol,ul"),k;if(l||h){k=f[d];a(j.items,function(n){var o=true;n.setSelected(0);if(l&&!n.isDisabled()){a(k,function(p){if(p.id==n.id){if(!c(l,p)){o=false;return false}}});if(o){n.setSelected(1)}}});if(!l){j.items[h.id].setSelected(1)}}});j.add({id:f.editor.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle"}).setDisabled(1);a(f[d],function(k){k.id=f.editor.dom.uniqueId();j.add({id:k.id,title:k.title,onclick:function(){h=k;g()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})();
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/autoresize/editor_plugin.js:
--------------------------------------------------------------------------------
1 | (function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this;if(a.getParam("fullscreen_is_enabled")){return}function b(){var h=a.getDoc(),e=h.body,j=h.documentElement,g=tinymce.DOM,i=d.autoresize_min_height,f;f=tinymce.isIE?e.scrollHeight:j.offsetHeight;if(f>d.autoresize_min_height){i=f}g.setStyle(g.get(a.id+"_ifr"),"height",i+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});a.onLoadContent.add(function(f,e){b();setTimeout(function(){b();f.setProgressState(false);d.throbbing=false},1250)})}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/autosave/langs/en.js:
--------------------------------------------------------------------------------
1 | tinyMCE.addI18n('en.autosave',{
2 | restore_content: "Restore auto-saved content",
3 | warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"
4 | });
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/contextmenu/editor_plugin.js:
--------------------------------------------------------------------------------
1 | (function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this,g;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(h,i){if(!i.ctrlKey){if(g){h.selection.setRng(g)}f._getMenu(h).showMenu(i.clientX,i.clientY);a.add(h.getDoc(),"click",function(j){e(h,j)});a.cancel(i)}});d.onRemove.add(function(){if(f._menu){f._menu.removeAll()}});function e(h,i){g=null;if(i&&i.button==2){g=h.selection.getRng();return}if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(h.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e)},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/directionality/editor_plugin.js:
--------------------------------------------------------------------------------
1 | (function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/directionality/editor_plugin_src.js:
--------------------------------------------------------------------------------
1 | /**
2 | * editor_plugin_src.js
3 | *
4 | * Copyright 2009, Moxiecode Systems AB
5 | * Released under LGPL License.
6 | *
7 | * License: http://tinymce.moxiecode.com/license
8 | * Contributing: http://tinymce.moxiecode.com/contributing
9 | */
10 |
11 | (function() {
12 | tinymce.create('tinymce.plugins.Directionality', {
13 | init : function(ed, url) {
14 | var t = this;
15 |
16 | t.editor = ed;
17 |
18 | ed.addCommand('mceDirectionLTR', function() {
19 | var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
20 |
21 | if (e) {
22 | if (ed.dom.getAttrib(e, "dir") != "ltr")
23 | ed.dom.setAttrib(e, "dir", "ltr");
24 | else
25 | ed.dom.setAttrib(e, "dir", "");
26 | }
27 |
28 | ed.nodeChanged();
29 | });
30 |
31 | ed.addCommand('mceDirectionRTL', function() {
32 | var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
33 |
34 | if (e) {
35 | if (ed.dom.getAttrib(e, "dir") != "rtl")
36 | ed.dom.setAttrib(e, "dir", "rtl");
37 | else
38 | ed.dom.setAttrib(e, "dir", "");
39 | }
40 |
41 | ed.nodeChanged();
42 | });
43 |
44 | ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
45 | ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});
46 |
47 | ed.onNodeChange.add(t._nodeChange, t);
48 | },
49 |
50 | getInfo : function() {
51 | return {
52 | longname : 'Directionality',
53 | author : 'Moxiecode Systems AB',
54 | authorurl : 'http://tinymce.moxiecode.com',
55 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
56 | version : tinymce.majorVersion + "." + tinymce.minorVersion
57 | };
58 | },
59 |
60 | // Private methods
61 |
62 | _nodeChange : function(ed, cm, n) {
63 | var dom = ed.dom, dir;
64 |
65 | n = dom.getParent(n, dom.isBlock);
66 | if (!n) {
67 | cm.setDisabled('ltr', 1);
68 | cm.setDisabled('rtl', 1);
69 | return;
70 | }
71 |
72 | dir = dom.getAttrib(n, 'dir');
73 | cm.setActive('ltr', dir == "ltr");
74 | cm.setDisabled('ltr', 0);
75 | cm.setActive('rtl', dir == "rtl");
76 | cm.setDisabled('rtl', 0);
77 | }
78 | });
79 |
80 | // Register plugin
81 | tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
82 | })();
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/editor_plugin.js:
--------------------------------------------------------------------------------
1 | (function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce);
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/editor_plugin_src.js:
--------------------------------------------------------------------------------
1 | /**
2 | * editor_plugin_src.js
3 | *
4 | * Copyright 2009, Moxiecode Systems AB
5 | * Released under LGPL License.
6 | *
7 | * License: http://tinymce.moxiecode.com/license
8 | * Contributing: http://tinymce.moxiecode.com/contributing
9 | */
10 |
11 | (function(tinymce) {
12 | tinymce.create('tinymce.plugins.EmotionsPlugin', {
13 | init : function(ed, url) {
14 | // Register commands
15 | ed.addCommand('mceEmotion', function() {
16 | ed.windowManager.open({
17 | file : url + '/emotions.htm',
18 | width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)),
19 | height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)),
20 | inline : 1
21 | }, {
22 | plugin_url : url
23 | });
24 | });
25 |
26 | // Register buttons
27 | ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'});
28 | },
29 |
30 | getInfo : function() {
31 | return {
32 | longname : 'Emotions',
33 | author : 'Moxiecode Systems AB',
34 | authorurl : 'http://tinymce.moxiecode.com',
35 | infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
36 | version : tinymce.majorVersion + "." + tinymce.minorVersion
37 | };
38 | }
39 | });
40 |
41 | // Register plugin
42 | tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);
43 | })(tinymce);
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-cool.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-cool.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-cry.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-cry.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-embarassed.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-embarassed.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-frown.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-frown.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-innocent.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-innocent.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-kiss.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-kiss.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-laughing.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-laughing.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-sealed.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-sealed.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-smile.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-smile.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-surprised.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-surprised.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-undecided.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-undecided.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-wink.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-wink.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/img/smiley-yell.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/emotions/img/smiley-yell.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/js/emotions.js:
--------------------------------------------------------------------------------
1 | tinyMCEPopup.requireLangPack();
2 |
3 | var EmotionsDialog = {
4 | init : function(ed) {
5 | tinyMCEPopup.resizeToInnerSize();
6 | },
7 |
8 | insert : function(file, title) {
9 | var ed = tinyMCEPopup.editor, dom = ed.dom;
10 |
11 | tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
12 | src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
13 | alt : ed.getLang(title),
14 | title : ed.getLang(title),
15 | border : 0
16 | }));
17 |
18 | tinyMCEPopup.close();
19 | }
20 | };
21 |
22 | tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);
23 |
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/emotions/langs/en_dlg.js:
--------------------------------------------------------------------------------
1 | tinyMCE.addI18n('en.emotions_dlg',{
2 | title:"Insert emotion",
3 | desc:"Emotions",
4 | cool:"Cool",
5 | cry:"Cry",
6 | embarassed:"Embarassed",
7 | foot_in_mouth:"Foot in mouth",
8 | frown:"Frown",
9 | innocent:"Innocent",
10 | kiss:"Kiss",
11 | laughing:"Laughing",
12 | money_mouth:"Money mouth",
13 | sealed:"Sealed",
14 | smile:"Smile",
15 | surprised:"Surprised",
16 | tongue_out:"Tongue out",
17 | undecided:"Undecided",
18 | wink:"Wink",
19 | yell:"Yell"
20 | });
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/example/dialog.htm:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {#example_dlg.title}
5 |
6 |
7 |
8 |
9 |
10 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/example/editor_plugin.js:
--------------------------------------------------------------------------------
1 | (function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})();
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/example/img/example.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pedrofranceschi/Blogode/842c58e4892ee95bf3b7e4cb02ede6c7f558562b/public/tiny_mce/plugins/example/img/example.gif
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/example/js/dialog.js:
--------------------------------------------------------------------------------
1 | tinyMCEPopup.requireLangPack();
2 |
3 | var ExampleDialog = {
4 | init : function() {
5 | var f = document.forms[0];
6 |
7 | // Get the selected contents as text and place it in the input
8 | f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});
9 | f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');
10 | },
11 |
12 | insert : function() {
13 | // Insert the contents from the input into the document
14 | tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);
15 | tinyMCEPopup.close();
16 | }
17 | };
18 |
19 | tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);
20 |
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/example/langs/en.js:
--------------------------------------------------------------------------------
1 | tinyMCE.addI18n('en.example',{
2 | desc : 'This is just a template button'
3 | });
4 |
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/example/langs/en_dlg.js:
--------------------------------------------------------------------------------
1 | tinyMCE.addI18n('en.example_dlg',{
2 | title : 'This is just a example title'
3 | });
4 |
--------------------------------------------------------------------------------
/public/tiny_mce/plugins/fullpage/editor_plugin.js:
--------------------------------------------------------------------------------
1 | (function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(d,a){var l,c,e,g,b,h,j,f=this.head.match(/body(.*?)>/i);if(f&&f[1]){l=f[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(l){for(c=0,e=l.length;c",a);h.head=f.substring(0,a+1);j=f.indexOf("\n";h.foot="\n
<%= unescape(comments[i].author_name) %>
40 |<%= unescape(comments[i].comment) %>
41 |