Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Commit

Permalink
Merge pull request #99 from jmohler1970/FW/1
Browse files Browse the repository at this point in the history
FW/1
  • Loading branch information
jmohler1970 committed Dec 6, 2015
2 parents 0edf367 + 473ce81 commit 4504efa
Show file tree
Hide file tree
Showing 134 changed files with 3,893 additions and 263 deletions.
86 changes: 66 additions & 20 deletions application.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,40 @@
component extends="framework.one" accessors="true" {


this.name="bs-4-cf-51";
this.name="bs-4-cf-282";
this.applicationManagement = true;
this.sessionManagement = true;


variables.framework = {
home = "main.home",
home = "docs.home", // For PlumaCMS, change this to wiki.home or main.home aka login OR wiki.home
baseURL = 'useCGIScriptName',
defaultItem = "home",
generateSES = true,
SESomitIndex = false
};

variables.framework.routes = [
{ "_bootstrap" = "302:/main/home" },
{ "common" = "docs/common" },
{ "theme/:id" = "main/theme/theme/:id" },
{ "theme" = "main/theme" }
// PlumaCMS
{ "backups/delete/:id" = "backups/delete/slug/:id"},
{ "backups/edit/:id" = "backups/edit/slug/:id"},
{ "backups/restore/:id" = "backups/restore/slug/:id"},
{ "components" = "theme/components" },
{ "edit/:id" = "pages/edit/slug/:id" },
{ "edit" = "pages/edit" },
{ "filedelete" = "pages/delete" },
{ "logout" = "login/logout" },
{ "pages/home" = "pages/home" },
{ "wiki/:id" = "wiki/home/slug/:id" },

// documentation
{ "_bootstrap" = "302:/main/home" },
{ "common" = "docs/common" },
{ "theme" = "theme/home" },
{ "bootswatch/:id" = "bootswatch/home/bootswatch/:id" }
];







Expand All @@ -34,6 +46,32 @@ function setupApplication() {

application.initialized = now();

local.objAppFile = fileopen(expandpath('./Application.cfc'), 'read');

application.GSVERSION = "Version 3.3.5.#right(year(local.objAppFile.lastmodified), 2)#.#month(local.objAppFile.lastmodified)#.#day(local.objAppFile.lastmodified)#";
fileclose(objAppFile);


// Common variables and paths
application.GSAUTHOR = "James Mohler and Web World Inc";
application.GSSITE_FULL_NAME = "PlumaCMS";
application.GSSITE_LINK_BACK_URL = "https://github.com/jmohler1970";

application.GSROOTPATH = getdirectoryfrompath(getBaseTemplatePath());
application.GSBACKUPSPATH = application.GSROOTPATH & "backups/";
application.GSDATAPATH = application.GSROOTPATH & "data/";
application.GSDATAOTHERPATH = application.GSROOTPATH & "data/other/";
application.GSTHUMBNAILPATH = application.GSROOTPATH & "data/thumbs/";
application.GSDATAPAGESPATH = application.GSROOTPATH & "data/pages/";
application.GSDATAUPLOADPATH = application.GSROOTPATH & "data/uploads/";
application.GSUSERSPATH = application.GSROOTPATH & "data/users/";
// End Pluma


// Support for complicated variables. This used to have to be in FW/1
application.objFormUtilities = new framework.formUtilities();


application.Bootstrap = {

// Antisamy options
Expand All @@ -51,16 +89,17 @@ function setupApplication() {
langRoot = expandPath("vendor/lang") & "/",
arLang = [],

actionRoot = cgi.script_name,
actionRoot = "http://" & cgi.server_name & (cgi.server_port == 80 ? "" : ":" & cgi.server_port) & cgi.script_name & "/",
validLook = ["", "link", "default", "primary", "success", "info", "warning", "danger"], // There does not guarantee they are valid

iconLibrary = {"default" = "glyphicon glyphicon-", "awesome" = "fa fa-", "jquery-ui" = "ui-icon ui-icon-"}, // be sure to include ending dashes
imageLibrary = {"default" = replace(cgi.script_name, "/index.cfm", "") & "/assets/"}, // used by b:graphicImage

// used by b:outputStyleSheet
styleSheetLibrary = {"default" = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css",
local = replace(cgi.script_name, "/index.cfm", "") & "/assets/",
vendor = replace(cgi.script_name, "/index.cfm", "") & "/vendor/"
local = replace(cgi.script_name, "/index.cfm", "") & "/assets/",
innovation = replace(cgi.script_name, "/index.cfm", "") & "/layouts/innovation/",
vendor = replace(cgi.script_name, "/index.cfm", "") & "/vendor/"
},

// used by b:outputScript
Expand All @@ -71,7 +110,7 @@ function setupApplication() {
};



application.GSConfig = new model.services.settings().getWebsite();



Expand All @@ -80,9 +119,9 @@ function setupApplication() {
if (!isArray(arguments.placeholder)) arguments.placeholder = [arguments.placeholder];


if (CacheIdExists(session.lang, application.Bootstrap.cache.language)) {
if (CacheIdExists(application.lang, application.Bootstrap.cache.language)) {

local.stLang = cacheGet(session.lang, application.Bootstrap.cache.language);
local.stLang = cacheGet(application.lang, application.Bootstrap.cache.language);



Expand All @@ -104,16 +143,18 @@ function setupApplication() {
}; // end function



// Language control
application.lang = "en_US"; // needs to be smarter


} // end setupApplication


function setupSession() {

session.themeX = "default";
session.lang = "en_US";
session.authenticated = false;

session.bootswatch = "default";
}


Expand Down Expand Up @@ -163,15 +204,20 @@ function setupRequest() {


function after() {



if ( isDefined('form') ) rc.Append(application.objFormUtilities.buildFormCollections(form));


if(rc.keyExists("lang")) {
session.lang = rc.lang;
application.lang = rc.lang;
}


if(rc.keyExists("theme") and rc.theme != "assets") {
if(rc.keyExists("bootswatch") and rc.bootswatch != "assets") {

session.themeX = rc.theme;
session.bootswatch = rc.bootswatch;
}


Expand Down
106 changes: 98 additions & 8 deletions assets/application.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,106 @@
$( document ).ready(function() {

// pages
$(document).on("click", "#show-characters", function() {
$(".showstatus").toggle();
$(this).toggleClass('current');
});


$(document).on("click", "#post-menu-enable", function() {

$("#menu-items").slideToggle("fast");
});
if ($("#post-menu-enable").is(":checked")) {
} else {
$("#menu-items").css("display","none");
}

//pages.edit
function updateMetaDescriptionCounter() {
var remaining = 155 - jQuery('#post-metad').val().length;
jQuery('#countdown').text(remaining);
Debugger.log('Meta Description has '+remaining+' characters remaining');
}

if ($('#post-metad').length) {
updateMetaDescriptionCounter();
$('#post-metad').change(updateMetaDescriptionCounter);
$('#post-metad').keyup(updateMetaDescriptionCounter);
}

$('[data-toggle="popover"]').popover();
$('[data-toggle="tooltip"]').tooltip();

// pages.home
$(document).on("click", ".delconfirm", function() {
var message = $(this).attr("title");
var dlink = $(this).attr("href");
var mytr=$(this).parents("tr");
mytr.css("font-style", "italic");
var answer = confirm(message);
if (answer) {
return true;
}
else
{
mytr.css('font-style', 'normal');
return false;
}
});



$('[data-toggle="popover"]').popover();
$('[data-toggle="tooltip"]').tooltip();


$('select.select2').select2();

$('table.datatables').DataTable({
paging : false,
order : [[ 1, "asc" ]]
});



//create new folder in pages
var newFolderDiv = $("#new-folder");

$(document).on("click", "#createfolder", function($e) {
$e.preventDefault();
newFolderDiv.find("form").show();
$(this).hide();
newFolderDiv.find('#foldername').focus();
});

$(document).on("click", "#new-folder .cancel", function($e) {
$e.preventDefault();
newFolderDiv.find("#foldername").val('');
newFolderDiv.find("form").hide();
$('#createfolder').show();
});

$(document).on("click", "#metadata_toggle", function($e) {
$e.preventDefault();
$("#metadata_window").slideToggle('fast');
$("#link_window").slideToggle('fast');
$(this).toggleClass('current');
});



//upload/details
var copyKitTextArea = $('textarea.copykit');
$("select#img_info").change(function () {
var codetype = $(this).val();
var code = $('p#' + codetype).html();
var originalBG = $('textarea.copykit').css('background-color');
var fadeColor = "#FFFFD1";
copyKitTextArea.fadeOut(500).fadeIn(500).html(code);
});
$(document).on("click", ".select-all", function () {
copyKitTextArea.focus().select();
return false;
});

$('select.select2').select2();

$('table.datatables').DataTable({
paging : false,
order : [[ 1, "asc" ]]
});

});
48 changes: 48 additions & 0 deletions controllers/backupsController.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
component accessors="true" {

property beanFactory;
property framework;

property pageService;


void function home(required struct rc) output="false" {


if(rc.keyExists("deleteall")) {
pageService.deleteAllBackups();
}

rc.qryBackup = pageService.findBackups();
}


void function edit(required struct rc) output="false" {

rc.append(pageService.get(rc.slug, application.GSBACKUPSPATH & "pages/" ));
}


void function restore(required struct rc) {

pageService.restoreBackup(rc.slug);
variables.framework.redirect("pages.home", "all");
}


void function delete(required struct rc) {

pageService.deleteBackup(rc.slug);

variables.framework.redirect(".home", "all");
}


void function after(require struct rc) {

variables.framework.setLayout("pages");
}



}
17 changes: 17 additions & 0 deletions controllers/bootswatchController.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
component accessors="true" {

property beanFactory;
property framework;





void function after(require struct rc) {

variables.framework.setLayout("docs");
}



}
20 changes: 0 additions & 20 deletions controllers/docs.cfc

This file was deleted.

Loading

0 comments on commit 4504efa

Please sign in to comment.