This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar *cache-dir* '(:relative "cache")) | |
(defvar *cache-enabled-p* nil) | |
(defvar *drakma-request-max-tries* nil) ; | |
(defvar *character-for-wrong-utf-8-chars* #\@) | |
; V5 | |
(defun drakma-request (&rest args) | |
"Gets url contents using drakma:http-request. | |
Tries several times to do it on error. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ql:quickload :ironclad) | |
(ql:quickload :cl-ppcre) | |
(ql:quickload :arnesi) | |
(ql:quickload :cl-prevalence) | |
(ql:quickload :closure-html) | |
(ql:quickload :cxml) | |
(ql:quickload :split-sequence) | |
(defun nl2br (text) | |
(cl-ppcre:regex-replace-all #\newline text "<br/>")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defclass bootstrap-date-parser (date-parser) | |
()) | |
(defmethod parse-view-field-value ((parser date-parser) value obj | |
(view form-view) (field form-view-field) &rest args) | |
(declare (ignore args)) | |
(let* ((name (attributize-name (view-field-slot-name field))) | |
(date (request-parameter (format nil "~A[date]" name))) | |
(time (request-parameter (format nil "~A[time]" name))) | |
(hour)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cl-config:set-value :weblocks.tinymce-textarea-presentation.tinymce-settings "({ | |
debug: true, | |
script_url : '/pub/scripts/tiny_mce/tiny_mce.js', | |
theme : 'advanced', | |
plugins : 'pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template', | |
theme_advanced_buttons1: 'save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect', | |
theme_advanced_buttons2: 'cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor', | |
theme_advanced_bu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defclass advanced-table-view (table-view) | |
((fields-order :initarg :fields-order :initform nil))) | |
(defclass advanced-table-view-field (table-view-field) | |
()) | |
(defclass advanced-table-scaffold (table-scaffold) | |
()) | |
(defun %map-object-view-fields (proc obj view-designator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(yaclml::def-empty-html-tag <:input :core :event :i18n | |
accept | |
accesskey | |
alt | |
checked | |
disabled | |
maxlength | |
name | |
onblur |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def-weblocks-yaclml-mustache | |
bootstrap-navigation-tabs-item-layout | |
(<:li :id "{{{item-id}}}" :class "{{#pane-selected-p}} active{{/pane-selected-p}}" | |
"{{#pane-selected-or-disabled-p}}" | |
(<:a :href "#" "{{{label}}}") | |
"{{/pane-selected-or-disabled-p}}" | |
"{{^pane-selected-or-disabled-p}}" | |
(<:a :href "{{{link}}}" | |
(<:as-is "{{{label}}}")) | |
"{{/pane-selected-or-disabled-p}}")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro def-weblocks-mustache (name template) | |
"Define a named renderer of string TEMPLATE." | |
(let ((obj (gensym))) | |
`(let ((,obj (mustache::parse ,template))) | |
(defun ,name (&optional context) | |
(let ((mustache:*mustache-output* (make-string-output-stream))) | |
(mustache::render-body ,obj context ,template) | |
(get-output-stream-string mustache:*mustache-output*)))))) | |
(defmacro def-weblocks-yaclml-mustache (name &body body) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun normalize-newlines (string) | |
(ppcre:regex-replace-all (format nil "~C(\n)?" #\return) string "\n")) | |
(assert (string= (normalize-newlines "as\ndf") "as\ndf")) | |
(assert (string= (normalize-newlines (format nil "as~C\ndf" #\return)) "as\ndf")) | |
(assert (string= (normalize-newlines (format nil "as~Cdf" #\return)) "as\ndf")) |