first commit

This commit is contained in:
benjibennn
2023-12-22 12:35:55 +08:00
commit 9f89a732d6
872 changed files with 156291 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("advlist",function(e){function t(t){return e.$.contains(e.getBody(),t)}function n(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)&&t(e)}function r(e,t){var n=[];return t&&tinymce.each(t.split(/[ ,]/),function(e){n.push({text:e.replace(/\-/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}),data:"default"==e?"":e})}),n}function i(t,n){e.undoManager.transact(function(){var r,i=e.dom,o=e.selection;if(r=i.getParent(o.getNode(),"ol,ul"),!r||r.nodeName!=t||n===!1){var a={"list-style-type":n?n:""};e.execCommand("UL"==t?"InsertUnorderedList":"InsertOrderedList",!1,a)}r=i.getParent(o.getNode(),"ol,ul"),r&&tinymce.util.Tools.each(i.select("ol,ul",r).concat([r]),function(e){e.nodeName!==t&&n!==!1&&(e=i.rename(e,t)),i.setStyle(e,"listStyleType",n?n:null),e.removeAttribute("data-mce-style")}),e.focus()})}function o(t){var n=e.dom.getStyle(e.dom.getParent(e.selection.getNode(),"ol,ul"),"listStyleType")||"";t.control.items().each(function(e){e.active(e.settings.data===n)})}var a,s,l=function(e,t){var n=e.settings.plugins?e.settings.plugins:"";return tinymce.util.Tools.inArray(n.split(/[ ,]/),t)!==-1};a=r("OL",e.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),s=r("UL",e.getParam("advlist_bullet_styles","default,circle,disc,square"));var c=function(t){return function(){var r=this;e.on("NodeChange",function(e){var i=tinymce.util.Tools.grep(e.parents,n);r.active(i.length>0&&i[0].nodeName===t)})}};l(e,"lists")&&(e.addCommand("ApplyUnorderedListStyle",function(e,t){i("UL",t["list-style-type"])}),e.addCommand("ApplyOrderedListStyle",function(e,t){i("OL",t["list-style-type"])}),e.addButton("numlist",{type:a.length>0?"splitbutton":"button",tooltip:"Numbered list",menu:a,onPostRender:c("OL"),onshow:o,onselect:function(e){i("OL",e.control.settings.data)},onclick:function(){i("OL",!1)}}),e.addButton("bullist",{type:s.length>0?"splitbutton":"button",tooltip:"Bullet list",onPostRender:c("UL"),menu:s,onshow:o,onselect:function(e){i("UL",e.control.settings.data)},onclick:function(){i("UL",!1)}}))});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("anchor",function(e){var t=function(e){return!e.attr("href")&&(e.attr("id")||e.attr("name"))&&!e.firstChild},n=function(e){return function(n){for(var r=0;r<n.length;r++)t(n[r])&&n[r].attr("contenteditable",e)}},r=function(e){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(e)},i=function(){var t=e.selection.getNode(),n="A"==t.tagName&&""===e.dom.getAttrib(t,"href"),i="";n&&(i=t.id||t.name||""),e.windowManager.open({title:"Anchor",body:{type:"textbox",name:"id",size:40,label:"Id",value:i},onsubmit:function(i){var o=i.data.id;return r(o)?void(n?(t.removeAttribute("name"),t.id=o):(e.selection.collapse(!0),e.execCommand("mceInsertContent",!1,e.dom.createHTML("a",{id:o})))):(i.preventDefault(),void e.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."))}})};tinymce.Env.ceFalse&&e.on("PreInit",function(){e.parser.addNodeFilter("a",n("false")),e.serializer.addNodeFilter("a",n(null))}),e.addCommand("mceAnchor",i),e.addButton("anchor",{icon:"anchor",tooltip:"Anchor",onclick:i,stateSelector:"a:not([href])"}),e.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",onclick:i})});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("autolink",function(e){function t(e){i(e,-1,"(",!0)}function n(e){i(e,0,"",!0)}function r(e){i(e,-1,"",!1)}function i(e,t,n){function r(e,t){if(t<0&&(t=0),3==e.nodeType){var n=e.data.length;t>n&&(t=n)}return t}function i(e,t){1!=e.nodeType||e.hasChildNodes()?s.setStart(e,r(e,t)):s.setStartBefore(e)}function o(e,t){1!=e.nodeType||e.hasChildNodes()?s.setEnd(e,r(e,t)):s.setEndAfter(e)}var s,l,c,u,d,f,p,m,h,g;if("A"!=e.selection.getNode().tagName){if(s=e.selection.getRng(!0).cloneRange(),s.startOffset<5){if(m=s.endContainer.previousSibling,!m){if(!s.endContainer.firstChild||!s.endContainer.firstChild.nextSibling)return;m=s.endContainer.firstChild.nextSibling}if(h=m.length,i(m,h),o(m,h),s.endOffset<5)return;l=s.endOffset,u=m}else{if(u=s.endContainer,3!=u.nodeType&&u.firstChild){for(;3!=u.nodeType&&u.firstChild;)u=u.firstChild;3==u.nodeType&&(i(u,0),o(u,u.nodeValue.length))}l=1==s.endOffset?2:s.endOffset-1-t}c=l;do i(u,l>=2?l-2:0),o(u,l>=1?l-1:0),l-=1,g=s.toString();while(" "!=g&&""!==g&&160!=g.charCodeAt(0)&&l-2>=0&&g!=n);s.toString()==n||160==s.toString().charCodeAt(0)?(i(u,l),o(u,c),l+=1):0===s.startOffset?(i(u,0),o(u,c)):(i(u,l),o(u,c)),f=s.toString(),"."==f.charAt(f.length-1)&&o(u,c-1),f=s.toString(),p=f.match(a),p&&("www."==p[1]?p[1]="http://www.":/@$/.test(p[1])&&!/^mailto:/.test(p[1])&&(p[1]="mailto:"+p[1]),d=e.selection.getBookmark(),e.selection.setRng(s),e.execCommand("createlink",!1,p[1]+p[2]),e.settings.default_link_target&&e.dom.setAttrib(e.selection.getNode(),"target",e.settings.default_link_target),e.selection.moveToBookmark(d),e.nodeChanged())}}var o,a=/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i;return e.settings.autolink_pattern&&(a=e.settings.autolink_pattern),e.on("keydown",function(t){if(13==t.keyCode)return r(e)}),tinymce.Env.ie?void e.on("focus",function(){if(!o){o=!0;try{e.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(e.on("keypress",function(n){if(41==n.keyCode)return t(e)}),void e.on("keyup",function(t){if(32==t.keyCode)return n(e)}))});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("autoresize",function(e){function t(){return e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()}function n(r){var a,s,l,c,u,d,f,p,m,h,g,v,b=tinymce.DOM;if(s=e.getDoc()){if(l=s.body,c=s.documentElement,u=i.autoresize_min_height,!l||r&&"setcontent"===r.type&&r.initial||t())return void(l&&c&&(l.style.overflowY="auto",c.style.overflowY="auto"));f=e.dom.getStyle(l,"margin-top",!0),p=e.dom.getStyle(l,"margin-bottom",!0),m=e.dom.getStyle(l,"padding-top",!0),h=e.dom.getStyle(l,"padding-bottom",!0),g=e.dom.getStyle(l,"border-top-width",!0),v=e.dom.getStyle(l,"border-bottom-width",!0),d=l.offsetHeight+parseInt(f,10)+parseInt(p,10)+parseInt(m,10)+parseInt(h,10)+parseInt(g,10)+parseInt(v,10),(isNaN(d)||d<=0)&&(d=tinymce.Env.ie?l.scrollHeight:tinymce.Env.webkit&&0===l.clientHeight?0:l.offsetHeight),d>i.autoresize_min_height&&(u=d),i.autoresize_max_height&&d>i.autoresize_max_height?(u=i.autoresize_max_height,l.style.overflowY="auto",c.style.overflowY="auto"):(l.style.overflowY="hidden",c.style.overflowY="hidden",l.scrollTop=0),u!==o&&(a=u-o,b.setStyle(e.iframeElement,"height",u+"px"),o=u,tinymce.isWebKit&&a<0&&n(r))}}function r(t,i,o){tinymce.util.Delay.setEditorTimeout(e,function(){n({}),t--?r(t,i,o):o&&o()},i)}var i=e.settings,o=0;e.settings.inline||(i.autoresize_min_height=parseInt(e.getParam("autoresize_min_height",e.getElement().offsetHeight),10),i.autoresize_max_height=parseInt(e.getParam("autoresize_max_height",0),10),e.on("init",function(){var t,n;t=e.getParam("autoresize_overflow_padding",1),n=e.getParam("autoresize_bottom_margin",50),t!==!1&&e.dom.setStyles(e.getBody(),{paddingLeft:t,paddingRight:t}),n!==!1&&e.dom.setStyles(e.getBody(),{paddingBottom:n})}),e.on("nodechange setcontent keyup FullscreenStateChanged",n),e.getParam("autoresize_on_init",!0)&&e.on("init",function(){r(20,100,function(){r(5,1e3)})}),e.addCommand("mceAutoResize",n))});

View File

@@ -0,0 +1 @@
tinymce._beforeUnloadHandler=function(){var e;return tinymce.each(tinymce.editors,function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e},tinymce.PluginManager.add("autosave",function(e){function t(e,t){var n={s:1e3,m:6e4};return e=/^(\d+)([ms]?)$/.exec(""+(e||t)),(e[2]?n[e[2]]:1)*parseInt(e,10)}function n(){var e=parseInt(p.getItem(u+"time"),10)||0;return!((new Date).getTime()-e>f.autosave_retention)||(r(!1),!1)}function r(t){p.removeItem(u+"draft"),p.removeItem(u+"time"),t!==!1&&e.fire("RemoveDraft")}function i(){!c()&&e.isDirty()&&(p.setItem(u+"draft",e.getContent({format:"raw",no_events:!0})),p.setItem(u+"time",(new Date).getTime()),e.fire("StoreDraft"))}function o(){n()&&(e.setContent(p.getItem(u+"draft"),{format:"raw"}),e.fire("RestoreDraft"))}function a(){d||(setInterval(function(){e.removed||i()},f.autosave_interval),d=!0)}function s(){var t=this;t.disabled(!n()),e.on("StoreDraft RestoreDraft RemoveDraft",function(){t.disabled(!n())}),a()}function l(){e.undoManager.beforeChange(),o(),r(),e.undoManager.add()}function c(t){var n=e.settings.forced_root_block;return t=tinymce.trim("undefined"==typeof t?e.getBody().innerHTML:t),""===t||new RegExp("^<"+n+"[^>]*>((\xa0|&nbsp;|[ \t]|<br[^>]*>)+?|)</"+n+">|<br>$","i").test(t)}var u,d,f=e.settings,p=tinymce.util.LocalStorage;u=f.autosave_prefix||"tinymce-autosave-{path}{query}-{id}-",u=u.replace(/\{path\}/g,document.location.pathname),u=u.replace(/\{query\}/g,document.location.search),u=u.replace(/\{id\}/g,e.id),f.autosave_interval=t(f.autosave_interval,"30s"),f.autosave_retention=t(f.autosave_retention,"20m"),e.addButton("restoredraft",{title:"Restore last draft",onclick:l,onPostRender:s}),e.addMenuItem("restoredraft",{text:"Restore last draft",onclick:l,onPostRender:s,context:"file"}),e.settings.autosave_restore_when_empty!==!1&&(e.on("init",function(){n()&&c()&&o()}),e.on("saveContent",function(){r()})),window.onbeforeunload=tinymce._beforeUnloadHandler,this.hasDraft=n,this.storeDraft=i,this.restoreDraft=o,this.removeDraft=r,this.isEmpty=c});

View File

@@ -0,0 +1 @@
!function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(e){var t=this,n=e.getParam("bbcode_dialect","punbb").toLowerCase();e.on("beforeSetContent",function(e){e.content=t["_"+n+"_bbcode2html"](e.content)}),e.on("postProcess",function(e){e.set&&(e.content=t["_"+n+"_bbcode2html"](e.content)),e.get&&(e.content=t["_"+n+"_html2bbcode"](e.content))})},getInfo:function(){return{longname:"BBCode Plugin",author:"Ephox Corp",authorurl:"http://www.tinymce.com",infourl:"http://www.tinymce.com/wiki.php/Plugin:bbcode"}},_punbb_html2bbcode:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),t(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),t(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),t(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),t(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),t(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),t(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),t(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),t(/<font>(.*?)<\/font>/gi,"$1"),t(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),t(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),t(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),t(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),t(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),t(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),t(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),t(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),t(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),t(/<\/(strong|b)>/gi,"[/b]"),t(/<(strong|b)>/gi,"[b]"),t(/<\/(em|i)>/gi,"[/i]"),t(/<(em|i)>/gi,"[i]"),t(/<\/u>/gi,"[/u]"),t(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),t(/<u>/gi,"[u]"),t(/<blockquote[^>]*>/gi,"[quote]"),t(/<\/blockquote>/gi,"[/quote]"),t(/<br \/>/gi,"\n"),t(/<br\/>/gi,"\n"),t(/<br>/gi,"\n"),t(/<p>/gi,""),t(/<\/p>/gi,"\n"),t(/&nbsp;|\u00a0/gi," "),t(/&quot;/gi,'"'),t(/&lt;/gi,"<"),t(/&gt;/gi,">"),t(/&amp;/gi,"&"),e},_punbb_bbcode2html:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/\n/gi,"<br />"),t(/\[b\]/gi,"<strong>"),t(/\[\/b\]/gi,"</strong>"),t(/\[i\]/gi,"<em>"),t(/\[\/i\]/gi,"</em>"),t(/\[u\]/gi,"<u>"),t(/\[\/u\]/gi,"</u>"),t(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),t(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),t(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),t(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),t(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),t(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),e}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)}();

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("code",function(e){function t(){var t=e.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:e.getParam("code_dialog_width",600),minHeight:e.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(t){e.focus(),e.undoManager.transact(function(){e.setContent(t.data.code)}),e.selection.setCursorLocation(),e.nodeChanged()}});t.find("#code").value(e.getContent({source_view:!0}))}e.addCommand("mceCodeEditor",t),e.addButton("code",{icon:"code",tooltip:"Source code",onclick:t}),e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:t})});

View File

@@ -0,0 +1,138 @@
/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
direction: ltr;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("colorpicker",function(e){function t(t,n){function r(e){var t=new tinymce.util.Color(e),n=t.toRgb();o.fromJSON({r:n.r,g:n.g,b:n.b,hex:t.toHex().substr(1)}),i(t.toHex())}function i(e){o.find("#preview")[0].getEl().style.background=e}var o=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:n,onchange:function(){var e=this.rgb();o&&(o.find("#r").value(e.r),o.find("#g").value(e.g),o.find("#b").value(e.b),o.find("#hex").value(this.value().substr(1)),i(this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,t,n=o.find("colorpicker")[0];return e=this.name(),t=this.value(),"hex"==e?(t="#"+t,r(t),void n.value(t)):(t={r:o.find("#r").value(),g:o.find("#g").value(),b:o.find("#b").value()},n.value(t),void r(t))}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){t("#"+this.toJSON().hex)}});r(n)}e.settings.color_picker_callback||(e.settings.color_picker_callback=t)});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("contextmenu",function(e){var t,n,r=e.settings.contextmenu_never_use_native,i=function(e){return e.ctrlKey&&!r},o=function(){return tinymce.Env.mac&&tinymce.Env.webkit},a=function(){return n===!0};return e.on("mousedown",function(t){o()&&2===t.button&&!i(t)&&e.selection.isCollapsed()&&e.once("contextmenu",function(t){e.selection.placeCaretAt(t.clientX,t.clientY)})}),e.on("contextmenu",function(r){var o;if(!i(r)){if(r.preventDefault(),o=e.settings.contextmenu||"link openlink image inserttable | cell row column deletetable",t)t.show();else{var a=[];tinymce.each(o.split(/[ ,]/),function(t){var n=e.menuItems[t];"|"==t&&(n={text:t}),n&&(n.shortcut="",a.push(n))});for(var s=0;s<a.length;s++)"|"==a[s].text&&(0!==s&&s!=a.length-1||a.splice(s,1));t=new tinymce.ui.Menu({items:a,context:"contextmenu",classes:"contextmenu"}).renderTo(),t.on("hide",function(e){e.control===this&&(n=!1)}),e.on("remove",function(){t.remove(),t=null})}var l={x:r.pageX,y:r.pageY};e.inline||(l=tinymce.DOM.getPos(e.getContentAreaContainer()),l.x+=r.clientX,l.y+=r.clientY),t.moveTo(l.x,l.y),n=!0}}),{isContextMenuVisible:a}});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("directionality",function(e){function t(t){var n,r=e.dom,i=e.selection.getSelectedBlocks();i.length&&(n=r.getAttrib(i[0],"dir"),tinymce.each(i,function(e){r.getParent(e.parentNode,"*[dir='"+t+"']",r.getRoot())||(n!=t?r.setAttrib(e,"dir",t):r.setAttrib(e,"dir",null))}),e.nodeChanged())}function n(e){var t=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(n){t.push(n+"[dir="+e+"]")}),t.join(",")}e.addCommand("mceDirectionLTR",function(){t("ltr")}),e.addCommand("mceDirectionRTL",function(){t("rtl")}),e.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),e.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})});

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("emoticons",function(e,t){function n(){var e;return e='<table role="list" class="mce-grid">',tinymce.each(r,function(n){e+="<tr>",tinymce.each(n,function(n){var r=t+"/img/smiley-"+n+".gif";e+='<td><a href="#" data-mce-url="'+r+'" data-mce-alt="'+n+'" tabindex="-1" role="option" aria-label="'+n+'"><img src="'+r+'" style="width: 18px; height: 18px" role="presentation" /></a></td>'}),e+="</tr>"}),e+="</table>"}var r=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];e.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:n,onclick:function(t){var n=e.dom.getParent(t.target,"a");n&&(e.insertContent('<img src="'+n.getAttribute("data-mce-url")+'" alt="'+n.getAttribute("data-mce-alt")+'" />'),this.hide())}},tooltip:"Emoticons"})});

View File

@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<body>
<h3>Custom dialog</h3>
Input some text: <input id="content">
<button onclick="top.tinymce.activeEditor.windowManager.getWindows()[0].close();">Close window</button>
</body>
</html>

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("example",function(e,t){e.addButton("example",{text:"My button",icon:!1,onclick:function(){e.windowManager.open({title:"Example plugin",body:[{type:"textbox",name:"title",label:"Title"}],onsubmit:function(t){e.insertContent("Title: "+t.data.title)}})}}),e.addMenuItem("example",{text:"Example plugin",context:"tools",onclick:function(){e.windowManager.open({title:"TinyMCE site",url:t+"/dialog.html",width:600,height:400,buttons:[{text:"Insert",onclick:function(){var t=e.windowManager.getWindows()[0];e.insertContent(t.getContentWindow().document.getElementById("content").value),t.close()}},{text:"Close",onclick:"close"}]})}})});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("example_dependency",function(){},["example"]);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,r=document,i=r.body;return i.offsetWidth&&(e=i.offsetWidth,t=i.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){var e=tinymce.DOM.getViewPort();return{x:e.x,y:e.y}}function r(e){scrollTo(e.x,e.y)}function i(){function i(){f.setStyle(h,"height",t().h-(m.clientHeight-h.clientHeight))}var p,m,h,g,v=document.body,b=document.documentElement;d=!d,m=e.getContainer(),p=m.style,h=e.getContentAreaContainer().firstChild,g=h.style,d?(u=n(),o=g.width,a=g.height,g.width=g.height="100%",l=p.width,c=p.height,p.width=p.height="",f.addClass(v,"mce-fullscreen"),f.addClass(b,"mce-fullscreen"),f.addClass(m,"mce-fullscreen"),f.bind(window,"resize",i),i(),s=i):(g.width=o,g.height=a,l&&(p.width=l),c&&(p.height=c),f.removeClass(v,"mce-fullscreen"),f.removeClass(b,"mce-fullscreen"),f.removeClass(m,"mce-fullscreen"),f.unbind(window,"resize",s),r(u)),e.fire("FullscreenStateChanged",{state:d})}var o,a,s,l,c,u,d=!1,f=tinymce.DOM;if(!e.settings.inline)return e.on("init",function(){e.addShortcut("Ctrl+Shift+F","",i)}),e.on("remove",function(){s&&f.unbind(window,"resize",s)}),e.addCommand("mceFullScreen",i),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,onClick:function(){i(),e.focus()},onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Shift+F",onClick:i,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return d}}});

View File

@@ -0,0 +1,558 @@
* {
margin: 0;
padding: 0;
list-style: none;
outline: 0;
border: 0;
font-size: 0;
line-height: 0;
box-sizing: border-box;
-webkit-text-size-adjust: none;
-webkit-backface-visibility: hidden;
}
::-webkit-scrollbar {
height: 0 !important;
width: 0 !important;
}
a {
text-decoration: none;
color: #000;
}
a:hover {}
body {
/*margin-top:30px;*/
/*background-color:pink;*/
}
.ff_window_close_btn {
position: fixed;
top:10px;
right:10px;
color:white;
z-index: 5000;
display: none;
}
.ff_window_close_btn span {
color:white;
font-size:14px;
}
#app {
margin: auto auto;
width: 100%;
background-color: #fff;
color: #000;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: subpixel-antialiased;
background-color: #fff;
text-align: center;
position: relative;
}
#header {
position: absolute;
top: -45px;
vertical-align: bottom;
background-color: #000;
height: 45px;
text-align: center;
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.1), 0 1px 0 0 rgba(0,0,0,0.1);
width: 100%;
z-index: 1000;
}
#header .back-button {
display: none;
position: absolute;
left: 0px;
z-index: 10;
width: 20px;
max-height: 20px;
padding: 10px 10px 10px 10px;
margin: 12px 0px 0px 5px;
cursor: pointer;
background-image: url(../img/icon_back.png);
background-repeat: no-repeat;
background-size: 50%;
background-position: center;
}
#header .logo-image {
z-index: 10;
display:inline-block;
height: 25px;
/*max-height: 20px;*/
width:auto;
max-height: 45px;
margin: 5px 10px 10px 10px;
margin-left: 5px;
cursor: pointer;
}
#header .logo-text {
display:inline-block;
/*height: 45px;*/
max-height: 20px;
width:auto;
margin: 13px 10px 13px 0px;
cursor: pointer;
}
#container {
margin-top: 45px;
-webkit-overflow-scrolling: touch;
-webkit-font-smoothing: subpixel-antialiased;
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
overflow: scroll;
-ms-overflow-style: -ms-autohiding-scrollbar;
position: relative;
}
#gifs {
margin: 0 auto;
padding: 0 10px 0 10px;
}
#gifs > li {
display: inline-block;
width: 145px;
margin: 10px 0px 0px 0px;
border-radius: 3px;
background-color: #212121;
}
#gifs > li img {
width: 100%;
border-radius: 3px 3px 0 0;
background-color: #000;
}
.tags {
text-align: left;
width: 100%;
background-color: #000;
border-radius: 0px 0px 3px 3px;
}
.tags_inner {
padding: 7px 0px 7px 7px;
}
.tags > a {
color: #33c5f3;
display: inline-block;
margin-right: 5px;
font-size: 11px;
line-height: 14px;
}
.tags .tag {
color: #33c5f3;
display: inline-block;
-webkit-font-smoothing: subpixel-antialiased;
margin-right: 5px;
font-size: 11px;
line-height: 14px;
cursor: pointer;
}
.actions {
border-top: 1px solid #f0f0f0;
height: 40px;
background-color: #fff;
border-radius: 0px 0px 3px 3px;
display: none;
}
.actions > a {
display: inline-block;
}
.actions img {
background-color: #fff !important;
}
.tags a:after {
content: ",";
}
.tags a:last-child:after {
content: "";
}
.tag:after {
content: ",";
}
.tag:last-child:after {
content: "";
}
@-webkit-keyframes fadein {
from { opacity:0; }
to { opacity:1; }
}
@-webkit-keyframes fadeout {
from { opacity:1; }
to { opacity:0; }
}
.fade-in {
opacity: 0;
-webkit-animation: fadein .3s forwards;
}
.fade-out {
opacity: 1;
-webkit-animation: fadeout 1s;
}
#categories {
position: relative;
top: 0;
left: 0;
z-index: 40;
background-color: #fff;
display: none;
text-align: left;
}
#categories > li {
display: inline-block;
font-size: 16px;
line-height: 38px;
width: 100%;
color: #000;
text-transform: capitalize;
height: 40px;
border-bottom: 1px solid #e1e1e1;
padding: 0px 0px 0px 15px;
}
.category {
position: absolute;
top: 0;
left: 0;
z-index: 100;
width: 100%;
background-color: #fff;
display: none;
text-align: left;
}
.category > li {
display: inline-block;
font-size: 16px;
line-height: 38px;
width: 100%;
color: #000;
text-transform: capitalize;
height: 40px;
border-bottom: 1px solid #e1e1e1;
padding: 0px 0px 0px 15px;
}
#footer {
display: table;
text-align: left;
position: fixed;
bottom: 0;
background-color: #000;
height: 45px;
width: 100%;
z-index: 1000;
box-shadow: 0 -2px -2px 0 rgba(0,255,0,0.1), 0 1px 0 0 rgba(255,0,0,0.1);
}
#footer a {
display: table-cell;
width: 50px;
}
#searchbar {
display: table-cell;
vertical-align: middle;
/*background-color: #f0f0f0;*/
background-color: #000;
padding: 6px 3px 6px 6px;
-webkit-box-shadow: 0 1px 0px rgba(0,0,0,.1);
overflow: hidden;
/*box-sizing: content-box;*/
}
#searchbar input[type=text] {
height: 45px;
width: 100%;
padding: 0 15px 0px 20px;
/*margin-left:-10px;*/
/*margin-top:-10px;*/
font-size: 14px;
line-height: 24px;
border-radius: 3px;
background-color: #fff;
color: #000;
}
#footer #categories-button {
border-left: 5px solid #000;
width: 45px;
height: 45px;
background-image: url(../img/icon_menu.png);
background-repeat: no-repeat;
background-size: 28px 28px;
background-position: center;
cursor: pointer;
}
#footer #search-button {
border-right: 3px solid #000;
width: 50px;
height: 100%;
background-image: url(../img/icon_search.png);
background-repeat: no-repeat;
background-size: 28px 28px;
background-position: center;
cursor: pointer;
}
#gif-detail {
display: none;
text-align: left;
background-color: #000;
height: 100%;
overflow: hidden;
}
#gif-detail #gif-detail-gif {
width: 100%;
}
#gif-detail #loader{
display:none;
z-index:2;
position:absolute;
top: 50px;
right:5px;
width:20px;
}
#share-menu {
display: none;
z-index: 200;
letter-spacing: 0px;
position: fixed;
bottom: 0px;
//bottom: 45px;
width: 100%;
text-align:left;
font-weight:200;
-webkit-font-smoothin: subpixel-antialiased;
}
#share-menu .cancel {
height: 45px;
width: 100%;
background-color: #212121;
text-align: left;
font-size: 16px;
line-height: 45px;
color: #fff;
}
#share-menu #copy-gif {
width: 100%;
background-color: #000;
height: 45px;
font-size: 16px;
line-height: 45px;
color: #fff;
padding-left: 10px;
}
#gif-detail-tags {
background: #000;
}
#share-menu #gif-detail-link,
#share-menu #gif-detail-tags{
width: 100%;
height: 45px;
line-height: 45px;
color: #33c5f3;
padding-left: 10px;
/*background-color: #000;*/
}
#gif-detail-link {
background: #212121;
}
#share-menu #gif-detail-link a,
#share-menu #gif-detail-tags .gif-detail-tag{
color: #33c5f3;
font-size: 16px;
line-height: 45px;
margin: 0px 5px 0px 0px;
cursor: pointer;
}
#share-menu #gif-detail-link .gif-link-info {
color: #33c5f3;
font-size: 16px;
line-height: 45px;
margin: 0px 5px 0px 0px;
}
#share-menu #gif-detail-tags .gif-detail-tag:after {
content: ",";
}
#share-menu #gif-detail-tags .gif-detail-tag:last-child:after {
content: "";
}
#share-menu .share-menu {
width: 100%;
text-align: center;
height: 45px;
font-size: 16px;
line-height: 45px;
color: #fff;
background-color: #212121;
}
#share-menu .share-menu > li {
float: left;
display: inline-block;
width: 55px;
height: 100%;
line-height: 70px;
}
#share-menu .share-menu > li img {
height: 25px;
}
.sms-button {
background-color: #212121;
}
.facebook-button {
background-color: #3b5997;
}
.twitter-button {
background-color: #00acee;
}
.email-button {
background-color: #212121;
}
#categories .subtitle {
/*font-weight: bold;*/
background: black;
color:white;
}
#categories .popular_tag {
cursor: pointer;
}
#container {
width:480px;
height:500px;
}
#giphy_copy_box {
display:block;
visibility: visible;
z-index:-1;
font-weight:normal;
font-size:14px;
position: absolute;
top:0;
left:0;
}
#share-menu {
}
.mobile-share {
display:none;
}
#copy-gif {
display:none;
}
.giphy_gif_li {
position: relative;
padding-bottom:0px;
/*background-color: red;*/
display:inline-block;
}
.gif_drag_cover {
width:100%;
height:100%;
position: absolute;
background:rgba(0,0,0,0);
z-index:1000;
/*background-color: red;*/
top:0;
right:0;
}
.gif-detail-cover {
/*background-color: red;*/
width:100%;
position: absolute;
top:0;
right:0;
z-index:5000;
max-height: 375px;
}
.gif-inject-cms {
width: 100%;
height: 120px;
}
.mceMiddle,.mceRight,.mceLeft,.mceTop,.mceBottom {
background-color: #000 !important;
}
/** wp button style block **/
.button {display:inline-block;text-decoration:none;font-size:12px;line-height:23px;height:24px;margin:0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-border-radius:3px;-webkit-appearance:none;border-radius:3px;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
.button::-moz-focus-inner {border-width:1px 0;border-style:solid none;border-color:transparent;padding:0}
.button.button-large,.button-group.button-large .button{height:30px;line-height:28px;padding:0 12px 2px}
.button.button-small,.button-group.button-small .button{height:21px;line-height:20px;padding:0 8px 1px}
.button.button-hero,.button-group.button-hero .button{width: 100%; font-size:14px;height:46px;line-height:44px;padding:0 36px; z-index: 10000;}
.button:active{outline:0}
.button.hidden{display:none}
.button,.button-secondary{background:#f3f3f3;background-image:-webkit-gradient(linear,left top,left bottom,from(#fefefe),to(#f4f4f4));background-image:-webkit-linear-gradient(top,#fefefe,#f4f4f4);background-image:-moz-linear-gradient(top,#fefefe,#f4f4f4);background-image:-o-linear-gradient(top,#fefefe,#f4f4f4);background-image:linear-gradient(to bottom,#fefefe,#f4f4f4);border-color:#bbb;color:#333;text-shadow:0 1px 0 #fff}
.button.hover,.button:hover,.button-secondary:hover,.button.focus,.button:focus,.button-secondary:focus{background:#f3f3f3;background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#f3f3f3));background-image:-webkit-linear-gradient(top,#fff,#f3f3f3);background-image:-moz-linear-gradient(top,#fff,#f3f3f3);background-image:-ms-linear-gradient(top,#fff,#f3f3f3);background-image:-o-linear-gradient(top,#fff,#f3f3f3);background-image:linear-gradient(to bottom,#fff,#f3f3f3);border-color:#999;color:#222}
.button.focus,.button:focus,.button-secondary:focus{-webkit-box-shadow:1px 1px 1px rgba(0,0,0,.2);box-shadow:1px 1px 1px rgba(0,0,0,.2)}.button.active,.button.active:hover,.button.active:focus,.button:active,.button-secondary:active{background:#eee;background-image:-webkit-gradient(linear,left top,left bottom,from(#f4f4f4),to(#fefefe));background-image:-webkit-linear-gradient(top,#f4f4f4,#fefefe);background-image:-moz-linear-gradient(top,#f4f4f4,#fefefe);background-image:-ms-linear-gradient(top,#f4f4f4,#fefefe);background-image:-o-linear-gradient(top,#f4f4f4,#fefefe);background-image:linear-gradient(to bottom,#f4f4f4,#fefefe);border-color:#999;color:#333;text-shadow:0 -1px 0 #fff;-webkit-box-shadow:inset 0 2px 5px -3px rgba(0,0,0,0.5);box-shadow:inset 0 2px 5px -3px rgba(0,0,0,0.5)}
.button[disabled],.button:disabled,.button-secondary[disabled],.button-secondary:disabled,.button-disabled{color:#aaa!important;border-color:#ddd!important;background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#f4f4f4))!important;background-image:-webkit-linear-gradient(top,#f9f9f9,#f4f4f4)!important;background-image:-moz-linear-gradient(top,#f9f9f9,#f4f4f4)!important;background-image:-ms-linear-gradient(top,#f9f9f9,#f4f4f4)!important;background-image:-o-linear-gradient(top,#f9f9f9,#f4f4f4)!important;background-image:linear-gradient(to bottom,#f9f9f9,#f4f4f4)!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default}
.button-primary{background-color:#21759b;background-image:-webkit-gradient(linear,left top,left bottom,from(#2a95c5),to(#21759b));background-image:-webkit-linear-gradient(top,#2a95c5,#21759b);background-image:-moz-linear-gradient(top,#2a95c5,#21759b);background-image:-ms-linear-gradient(top,#2a95c5,#21759b);background-image:-o-linear-gradient(top,#2a95c5,#21759b);background-image:linear-gradient(to bottom,#2a95c5,#21759b);border-color:#21759b;border-bottom-color:#1e6a8d;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,0.5);box-shadow:inset 0 1px 0 rgba(120,200,230,0.5);color:#fff;text-decoration:none;text-shadow:0 1px 0 rgba(0,0,0,0.1)}.button-primary.hover,.button-primary:hover,.button-primary.focus,.button-primary:focus{background-color:#278ab7;background-image:-webkit-gradient(linear,left top,left bottom,from(#2e9fd2),to(#21759b));background-image:-webkit-linear-gradient(top,#2e9fd2,#21759b);background-image:-moz-linear-gradient(top,#2e9fd2,#21759b);background-image:-ms-linear-gradient(top,#2e9fd2,#21759b);background-image:-o-linear-gradient(top,#2e9fd2,#21759b);background-image:linear-gradient(to bottom,#2e9fd2,#21759b);border-color:#1b607f;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,0.6);box-shadow:inset 0 1px 0 rgba(120,200,230,0.6);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.3)}
.button-primary.focus,.button-primary:focus{border-color:#0e3950;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,0.6),1px 1px 2px rgba(0,0,0,0.4);box-shadow:inset 0 1px 0 rgba(120,200,230,0.6),1px 1px 2px rgba(0,0,0,0.4)} .button-primary.active, .button-primary.active:hover, .button-primary.active:focus, .button-primary:active{background:#1b607f;background-image:-webkit-gradient(linear,left top,left bottom,from(#21759b),to(#278ab7));background-image:-webkit-linear-gradient(top,#21759b,#278ab7);background-image:-moz-linear-gradient(top,#21759b,#278ab7);background-image:-ms-linear-gradient(top,#21759b,#278ab7);background-image:-o-linear-gradient(top,#21759b,#278ab7);background-image:linear-gradient(to bottom,#21759b,#278ab7);border-color:#124560 #2382ae #2382ae #2382ae;color:rgba(255,255,255,0.95);-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,0.1);box-shadow:inset 0 1px 0 rgba(0,0,0,0.1);text-shadow:0 1px 0 rgba(0,0,0,0.1)} .button-primary[disabled], .button-primary:disabled, .button-primary-disabled{color:#94cde7!important;background:#298cba!important;border-color:#1b607f!important;-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,0.1)!important;cursor:default}
/** end wp style block **/

View File

@@ -0,0 +1,368 @@
<!DOCTYPE html>
<html lang="en">
<title>Giphy Gif Search</title>
<meta name="description" content="Find and share Gifs via Giphy.">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,600,400" rel="stylesheet" type="text/css"/>
<link href="./css/giphyPopup.css" rel="stylesheet" type="text/css"/>
<!-- ext -->
<!-- this style tag must be inline! -->
<style type="text/css">
.loading_icon_box {
position: fixed;
top:0;
left:0;
z-index:7000;
}
.loading_icon {
z-index:10000;
/*position: absolute;*/
/*bottom:0;*/
/*right:0;*/
/*width: 100%;*/
/*height:100%;*/
width:40px;
height:40px;
bottom:5px;
right:6px;
position: fixed;
/*background: rgba(10,10,10,0.7);*/
}
.loading_icon img {
width:35px;
height:35px;
}
/* .loading_icon:before {
content:"loading";
color:white;
font-size:14px;
text-align: center;
position: absolute;
top:50%;
left:50%;
margin-left:-20px;
margin-top:-100px;
width:70px;
}*/
.loading_icon img {
/*position: absolute;*/
/*top:50%;*/
/*left:50%;*/
/*margin-left:-20px;*/
/*margin-top:-100px;*/
}
</style>
</head>
<body>
<div id="app">
<div class="loading_icon_box">
<div class="loading_icon">
<img width="40" border="0" alt="loading" height="40" src="data:image/gif;base64,R0lGODlhKAAoAKIEAP9m/0wZf5kz/2YAzP///wAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/wtYTVAgRGF0YVhNUDw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wOkNyZWF0ZURhdGU9IjIwMTMtMDQtMzBUMTM6MTg6MzEtMDQ6MDAiIHhtcDpNb2RpZnlEYXRlPSIyMDEzLTA1LTEzVDIxOjI3OjI4LTA0OjAwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDEzLTA1LTEzVDIxOjI3OjI4LTA0OjAwIiBkYzpmb3JtYXQ9ImltYWdlL2dpZiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0MTM5OUZFNUI0MzgxMUUyOUUzNUZFQTEzQkRGQjYwOSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0MTM5OUZFNkI0MzgxMUUyOUUzNUZFQTEzQkRGQjYwOSIgeG1wTU06T3JpZ2luYWxEb2N1bWVudElEPSJ4bXAuZGlkOkQzQjlFNEQ1MEUyMDY4MTE5MTA5RTM5QzBBN0IxMzZCIj4gPHhtcE1NOkhpc3Rvcnk+IDxyZGY6U2VxPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpEM0I5RTRENTBFMjA2ODExOTEwOUUzOUMwQTdCMTM2QiIgc3RFdnQ6d2hlbj0iMjAxMy0wNC0zMFQxMzoxODozMS0wNDowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giLz4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjAzODAxMTc0MDcyMDY4MTE5MTA5ODRFRUUyRDdDQjhGIiBzdEV2dDp3aGVuPSIyMDEzLTA1LTEzVDE3OjI2OjU0LTA0OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgc3RFdnQ6Y2hhbmdlZD0iLyIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6MDQ4MDExNzQwNzIwNjgxMTkxMDk4NEVFRTJEN0NCOEYiIHN0RXZ0OndoZW49IjIwMTMtMDUtMTNUMTc6MjY6NTQtMDQ6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDUzUgTWFjaW50b3NoIiBzdEV2dDpjaGFuZ2VkPSIvIi8+IDwvcmRmOlNlcT4gPC94bXBNTTpIaXN0b3J5PiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowNDgwMTE3NDA3MjA2ODExOTEwOTg0RUVFMkQ3Q0I4RiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpEM0I5RTRENTBFMjA2ODExOTEwOUUzOUMwQTdCMTM2QiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAUKAAQALAAAAAAoACgAAAOECLrcHTDKOZ21NOfLl/5R14GgyJGfeaGairGU68CxzNCV7eGhrvA9HxDi+w2LgGEAqWQei03oUzjVKQXYrHa7HXi/4HCYSyaLz+eyOotuf9drtxuulrfpZTsab9aL+Vx+f4BagmOEbIZviFiKi4yOXoyNkZMCkQOWmJqVk5uenZChiJgJACH5BAUKAAQALAAAAAAoACgAAAOEKLrcDTDKOZ21NOfLl/5R14GgyJGfeaGairGU68CxzNCV7eGhrvA9HxDi+w2LgiEAqWQei03oUzjVKQfYrHa7DXi/4HCYSyaLz+eyOotuf9drtxuulrfpZTsab9aL+Vx+f4BagmOEbIZviFiKi4yOXoyNkZMDkQGWmJqVk5uenZChiJgJACH5BAUKAAQALAAAAAAoACgAAAOEOLrcLTDKOZ21NOfLl/5R14GgyJGfeaGairGU68CxzNCV7eGhrvA9HxDi+w2Lg6EAqWQei03oUzjVKQPYrHa7BXi/4HCYSyaLz+eyOotuf9drtxuulrfpZTsab9aL+Vx+f4BagmOEbIZviFiKi4yOXoyNkZMBkQCWmJqVk5uenZChiJgJACH5BAUKAAQALAAAAAAoACgAAAOEGLrcPTDKOZ21NOfLl/5R14GgyJGfeaGairGU68CxzNCV7eGhrvA9HxDi+w2LgeEAqWQei03oUzjVKQHYrHa7FXi/4HCYSyaLz+eyOotuf9drtxuulrfpZTsab9aL+Vx+f4BagmOEbIZviFiKi4yOXoyNkZMAkQKWmJqVk5uenZChiJgJADs=" /></div></div>
<!-- HEADER -->
<div id="header">
<span id="back-button" class="back-button"> </span>
<!--<img id="back-button" class="back-button" src="img/icon_back.png"/>-->
<img class="logo-image" src="img/giphy_logo_laser.gif"/>
<img class="logo-text" src="img/giphy_logo_txt.png"/>
<div class="ff_window_close_btn"><span href="#">CLOSE</span></div>
</div>
<!-- /HEADER -->
<!-- CONTENT -->
<div id="container">
<!-- GIFS -->
<ul id="gifs"></ul>
<!-- /GIFS -->
<!-- GIF DETAIL -->
<div id="gif-detail">
<div draggable="true" class="gif-detail-cover"></div>
<img id="gif-detail-gif" src="">
<!-- <img id="loader" src="/img/loader_purple.gif"> -->
<!-- SHARE MENU -->
<div id="share-menu">
<div id="gif-detail-tags"></div>
<div id="gif-detail-link"></div>
<div id="gif-inject-cms"></div>
<div id="copy-gif">Tap and Hold to Copy GIF</div>
</div>
<!-- /SHARE MENU -->
</div>
<!-- /GIF DETAIL -->
<!-- CATEGORIES -->
<ul id="categories">
<li class="subtitle">Reactions</li>
<li class="popular_tag" data-tag="agree">agree</li>
<li class="popular_tag" data-tag="applause">applause</li>
<li class="popular_tag" data-tag="awesome">awesome</li>
<li class="popular_tag" data-tag="burn">burn</li>
<li class="popular_tag" data-tag="cool-story-bro">cool story bro</li>
<li class="popular_tag" data-tag="deal-with-it">deal with it</li>
<li class="popular_tag" data-tag="do-not-want">do not want</li>
<li class="popular_tag" data-tag="eye-roll">eye roll</li>
<li class="popular_tag" data-tag="facepalm">facepalm</li>
<li class="popular_tag" data-tag="finger-guns">finger guns</li>
<li class="popular_tag" data-tag="fist-bump">fist bump</li>
<li class="popular_tag" data-tag="fml">fml</li>
<li class="popular_tag" data-tag="frown">frown</li>
<li class="popular_tag" data-tag="goodbye">goodbye</li>
<li class="popular_tag" data-tag="gtfo">gtfo</li>
<li class="popular_tag" data-tag="hair-flip">hair flip</li>
<li class="popular_tag" data-tag="happy-dance">happy dance</li>
<li class="popular_tag" data-tag="hello">hello</li>
<li class="popular_tag" data-tag="help">help</li>
<li class="popular_tag" data-tag="high five">high five</li>
<li class="popular_tag" data-tag="hug">hug</li>
<li class="popular_tag" data-tag="idgaf">idgaf</li>
<li class="popular_tag" data-tag="idk">idk</li>
<li class="popular_tag" data-tag="kiss">kiss</li>
<li class="popular_tag" data-tag="lol">lol</li>
<li class="popular_tag" data-tag="meh">meh</li>
<li class="popular_tag" data-tag="mic drop">mic drop</li>
<li class="popular_tag" data-tag="middle finger">middle finger</li>
<li class="popular_tag" data-tag="no">no</li>
<li class="popular_tag" data-tag="oh-no-you-didnt">oh no you didnt</li>
<li class="popular_tag" data-tag="oh-snap">oh snap</li>
<li class="popular_tag" data-tag="ok">ok</li>
<li class="popular_tag" data-tag="omg">omg</li>
<li class="popular_tag" data-tag="oops">oops</li>
<li class="popular_tag" data-tag="please">please</li>
<li class="popular_tag" data-tag="popcorn">popcorn</li>
<li class="popular_tag" data-tag="seriously">seriously</li>
<li class="popular_tag" data-tag="shrug">shrug</li>
<li class="popular_tag" data-tag="shut-up">shut up</li>
<li class="popular_tag" data-tag="sigh">sigh</li>
<li class="popular_tag" data-tag="slow-clap">slow clap</li>
<li class="popular_tag" data-tag="smh">smh</li>
<li class="popular_tag" data-tag="smile">smile</li>
<li class="popular_tag" data-tag="sorry">sorry</li>
<li class="popular_tag" data-tag="squee">squee</li>
<li class="popular_tag" data-tag="suck it">suck it</li>
<li class="popular_tag" data-tag="table-flip">table flip</li>
<li class="popular_tag" data-tag="thank-you">thank you</li>
<li class="popular_tag" data-tag="thumbs-down">thumbs down</li>
<li class="popular_tag" data-tag="thumbs-up">thumbs up</li>
<li class="popular_tag" data-tag="ugh">ugh</li>
<li class="popular_tag" data-tag="want">want</li>
<li class="popular_tag" data-tag="what">what</li>
<li class="popular_tag" data-tag="whatever">whatever</li>
<li class="popular_tag" data-tag="win">win</li>
<li class="popular_tag" data-tag="wink">wink</li>
<li class="popular_tag" data-tag="wow">wow</li>
<li class="popular_tag" data-tag="wtf">wtf</li>
<li class="popular_tag" data-tag="yawn">yawn</li>
<li class="popular_tag" data-tag="yes">yes</li>
<li class="popular_tag" data-tag="yolo">yolo</li>
<li class="subtitle">Emotions</li>
<li class="popular_tag" data-tag="angry">angry</li>
<li class="popular_tag" data-tag="bored">bored</li>
<li class="popular_tag" data-tag="disappointed">disappointed</li>
<li class="popular_tag" data-tag="drunk">drunk</li>
<li class="popular_tag" data-tag="embarassed">embarassed</li>
<li class="popular_tag" data-tag="excited">excited</li>
<li class="popular_tag" data-tag="frustrated">frustrated</li>
<li class="popular_tag" data-tag="happy">happy</li>
<li class="popular_tag" data-tag="hungry">hungry</li>
<li class="popular_tag" data-tag="inspired">inspired</li>
<li class="popular_tag" data-tag="lonely">lonely</li>
<li class="popular_tag" data-tag="love">love</li>
<li class="popular_tag" data-tag="make-it-rain">make it rain</li>
<li class="popular_tag" data-tag="meh">meh</li>
<li class="popular_tag" data-tag="nervous">nervous</li>
<li class="popular_tag" data-tag="pain">pain</li>
<li class="popular_tag" data-tag="reaction">reaction</li>
<li class="popular_tag" data-tag="relaxed">relaxed</li>
<li class="popular_tag" data-tag="sad">sad</li>
<li class="popular_tag" data-tag="sassy">sassy</li>
<li class="popular_tag" data-tag="scared">scared</li>
<li class="popular_tag" data-tag="shocked">shocked</li>
<li class="popular_tag" data-tag="sick">sick</li>
<li class="popular_tag" data-tag="stressed">stressed</li>
<li class="popular_tag" data-tag="surprised">surprised</li>
<li class="popular_tag" data-tag="suspicious">suspicious</li>
<li class="popular_tag" data-tag="tired">tired</li>
<li class="popular_tag" data-tag="unimpressed">unimpressed</li>
<li class="subtitle">Actions</li>
<li class="popular_tag" data-tag="breaking-up">breaking up</li>
<li class="popular_tag" data-tag="cooking">cooking</li>
<li class="popular_tag" data-tag="crying">crying</li>
<li class="popular_tag" data-tag="dancing">dancing</li>
<li class="popular_tag" data-tag="dreaming">dreaming</li>
<li class="popular_tag" data-tag="drinking">drinking</li>
<li class="popular_tag" data-tag="eating">eating</li>
<li class="popular_tag" data-tag="fainting">fainting</li>
<li class="popular_tag" data-tag="falling">falling</li>
<li class="popular_tag" data-tag="fighting">fighting</li>
<li class="popular_tag" data-tag="finger-guns">finger guns</li>
<li class="popular_tag" data-tag="laughing">laughing</li>
<li class="popular_tag" data-tag="pout">pout</li>
<li class="popular_tag" data-tag="running">running</li>
<li class="popular_tag" data-tag="singing">singing</li>
<li class="popular_tag" data-tag="slapping">slapping</li>
<li class="popular_tag" data-tag="sleeping">sleeping</li>
<li class="popular_tag" data-tag="smiling">smiling</li>
<li class="popular_tag" data-tag="smoking">smoking</li>
<li class="popular_tag" data-tag="sneezing">sneezing</li>
<li class="popular_tag" data-tag="spinning">spinning</li>
<li class="popular_tag" data-tag="swimming">swimming</li>
<li class="popular_tag" data-tag="tossing drink">tossing drink</li>
<li class="popular_tag" data-tag="waiting">waiting</li>
<li class="subtitle">Animals</li>
<li class="popular_tag" data-tag="cat">cat</li>
<li class="popular_tag" data-tag="dog">dog</li>
<li class="popular_tag" data-tag="panda">panda</li>
<li class="popular_tag" data-tag="penguin">penguin</li>
<li class="popular_tag" data-tag="sloth">sloth</li>
<li class="subtitle">Celebrities</li>
<li class="popular_tag" data-tag="benedict-cumberbatch">benedict cumberbatch</li>
<li class="popular_tag" data-tag="david-tennent">david tennent</li>
<li class="popular_tag" data-tag="emma-stone">emma stone</li>
<li class="popular_tag" data-tag="emma-watson">emma watson</li>
<li class="popular_tag" data-tag="jennifer-lawrence">jennifer lawrence</li>
<li class="popular_tag" data-tag="jim-carrey">jim carrey</li>
<li class="popular_tag" data-tag="kate-upton">kate upton</li>
<li class="popular_tag" data-tag="kristen-wiig">kristen wiig</li>
<li class="popular_tag" data-tag="leonardo-dicaprio">leonardo dicaprio</li>
<li class="popular_tag" data-tag="matt-smith">matt smith</li>
<li class="popular_tag" data-tag="robert-downey jr">robert downey jr</li>
<li class="popular_tag" data-tag="ryan-gosling">ryan gosling</li>
<li class="popular_tag" data-tag="selena-gomez">selena gomez</li>
<li class="popular_tag" data-tag="tom-hiddleston">tom hiddleston</li>
<li class="subtitle">TV</li>
<li class="popular_tag" data-tag="30-rock">30 rock</li>
<li class="popular_tag" data-tag="adventure-time">adventure time</li>
<li class="popular_tag" data-tag="arrested-development">arrested development</li>
<li class="popular_tag" data-tag="breaking-bad">breaking bad</li>
<li class="popular_tag" data-tag="community">community</li>
<li class="popular_tag" data-tag="doctor-who">doctor who</li>
<li class="popular_tag" data-tag="family-guy">family guy</li>
<li class="popular_tag" data-tag="futurama">futurama</li>
<li class="popular_tag" data-tag="game-of-thrones">game of thrones</li>
<li class="popular_tag" data-tag="mad-men">mad men</li>
<li class="popular_tag" data-tag="new-girl">new girl</li>
<li class="popular_tag" data-tag="orange-is-the-new-black">orange is the new black</li>
<li class="popular_tag" data-tag="parks-and-recreation">parks and recreation</li>
<li class="popular_tag" data-tag="pokemon">pokemon</li>
<li class="popular_tag" data-tag="sailor-moon">sailor moon</li>
<li class="popular_tag" data-tag="seinfeld">seinfeld</li>
<li class="popular_tag" data-tag="sherlock">sherlock</li>
<li class="popular_tag" data-tag="spongebob-squarepants">spongebob squarepants</li>
<li class="popular_tag" data-tag="star-trek">star trek</li>
<li class="popular_tag" data-tag="supernatural">supernatural</li>
<li class="popular_tag" data-tag="the-simpsons">the simpsons</li>
<li class="popular_tag" data-tag="twin-peaks">twin peaks</li>
<li class="popular_tag" data-tag="workaholics">workaholics</li>
<li class="subtitle">Movies</li>
<li class="popular_tag" data-tag="american-psycho">american psycho</li>
<li class="popular_tag" data-tag="batman">batman</li>
<li class="popular_tag" data-tag="despicable me">despicable me</li>
<li class="popular_tag" data-tag="disney">disney</li>
<li class="popular_tag" data-tag="harry potter">harry potter</li>
<li class="popular_tag" data-tag="iron-man">iron man</li>
<li class="popular_tag" data-tag="mean-girls">mean girls</li>
<li class="popular_tag" data-tag="minions">minions</li>
<li class="popular_tag" data-tag="pulp-fiction">pulp fiction</li>
<li class="popular_tag" data-tag="scarface">scarface</li>
<li class="popular_tag" data-tag="star-wars">star wars</li>
<li class="subtitle">Music</li>
<li class="popular_tag" data-tag="beyonce">beyonce</li>
<li class="popular_tag" data-tag="britney-spears">britney spears</li>
<li class="popular_tag" data-tag="justin-bieber">justin bieber</li>
<li class="popular_tag" data-tag="kanye-west">kanye west</li>
<li class="popular_tag" data-tag="katy-perry">katy perry</li>
<li class="popular_tag" data-tag="lady-gaga">lady gaga</li>
<li class="popular_tag" data-tag="lana-del-rey">lana del rey</li>
<li class="popular_tag" data-tag="miley-cyrus">miley cyrus</li>
<li class="popular_tag" data-tag="nicki-minaj">nicki minaj</li>
<li class="popular_tag" data-tag="one-direction">one direction</li>
<li class="popular_tag" data-tag="rihanna">rihanna</li>
<li class="subtitle">Popular Tags</li>
<li class="popular_tag" data-tag="90s">90s</li>
<li class="popular_tag" data-tag="beach">beach</li>
<li class="popular_tag" data-tag="beer">beer</li>
<li class="popular_tag" data-tag="birthday">birthday</li>
<li class="popular_tag" data-tag="black and white">black and white</li>
<li class="popular_tag" data-tag="cheeseburger">cheeseburger</li>
<li class="popular_tag" data-tag="christmas">christmas</li>
<li class="popular_tag" data-tag="clouds">clouds</li>
<li class="popular_tag" data-tag="coffee">coffee</li>
<li class="popular_tag" data-tag="computer">computer</li>
<li class="popular_tag" data-tag="football">football</li>
<li class="popular_tag" data-tag="galaxy">galaxy</li>
<li class="popular_tag" data-tag="glitch">glitch</li>
<li class="popular_tag" data-tag="halloween">halloween</li>
<li class="popular_tag" data-tag="homestuck">homestuck</li>
<li class="popular_tag" data-tag="money">money</li>
<li class="popular_tag" data-tag="party">party</li>
<li class="popular_tag" data-tag="pizza">pizza</li>
<li class="popular_tag" data-tag="rain">rain</li>
<li class="popular_tag" data-tag="robot">robot</li>
<li class="popular_tag" data-tag="scary">scary</li>
<li class="popular_tag" data-tag="summer">summer</li>
<li class="popular_tag" data-tag="vintage">vintage</li>
<li class="popular_tag" data-tag="zombie">zombie</li>
</ul>
<!-- /CATEGORIES -->
</div>
<!-- /CONTENT -->
<!-- FOOTER -->
<div id="footer">
<a id="categories-button" href="#"></a>
<!-- SEARCH BAR -->
<div id="searchbar">
<input id="searchbar-input" type="text" name="q" placeholder="Search all the GIFs: Trending GIFs"/>
</div>
<!-- /SEARCH BAR -->
<a id="search-button" href="#"></a>
</div>
<!-- /FOOTER -->
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script type="text/javascript">
jQuery = $;
</script>
<!-- ext specific -->
<script src="js/newT.js"></script>
<script src="js/masonry.pkgd.min.js"></script>
<script src="js/GiphySearch.js"></script>
<!--[if IE]>
<script src="js/jquery.xdomainrequest.min.js"></script>
<![endif]-->
<script src="js/giphy_cms_ext.js"></script>
<script src="js/init.js"></script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,944 @@
/***
THIS IS SHARED CODE BASE
it NEEDS TESTS!
Implemented:
mobile web
chrome ext
firefox ext
safari ext
*/
var GiphySearch = {
MAX_TAGS: 5,
PLATFORM_COPY_PREPEND_TEXT:"",
MAX_GIF_WIDTH: 145,
SEARCH_PAGE_SIZE: 100,
INFINITE_SCROLL_PX_OFFSET: 100,
INFINITE_SCROLL_PAGE_SIZE: 50,
ANIMATE_SCROLL_PX_OFFSET: 200,
STILL_SCROLL_PAGES: 1,
SCROLLTIMER_DELAY: 250,
SCROLL_MOMENTUM_THRESHOLD: 100,
ALLOW_URL_UPDATES:true, // enable history pushstate via add_history method
API_KEY:"G46lZIryTGCUU",
//API_KEY: parent.tinyMCE.activeEditor.getParam('api_key'),
location:{}, // for chrome ext
// navigation vars
curPage: "gifs",
// scrolling vars
curScrollPos: 0,
prevScrollPos: 0,
isRendering: false,
// event buffer timers
scrollTimer: 0,
searchTimer: 0,
renderTimer: 0,
// infinite scroll vars
curGifsNum: 0, // for offset to API server
curResponse: null,
prevResponse: null,
// search vars
curSearchTerm: "",
prevSearchTerm: "",
init: function(data) {
//console.log("init()");
if(GiphySearch.is_ext()) {
//GiphySearch.init_chrome_extension();
} else {
// fix me! target FF only somehow
//GiphySearch.init_firefox_extension();
}
GiphySearch.bind_events();
},
bind_events:function() {
//console.log("bind_events");
jQuery(window).on('popstate', function(event) {
GiphySearch.handleBrowserNavigation.call(this,event);
});
// set the container height for scrolling
// container.height(jQuery(window).height());
var $container = jQuery("#container");
// watch scroll events for desktop
$container.on("scroll", function(event) {
//console.log("scroll event");
GiphySearch.scroll.call(this,event);
}).on("click", ".tag", function(event) {
GiphySearch.handleTag.call(this,event);
}).on("click", ".gif_drag_cover", function(event) {
//console.log("handle gif drag cover");
GiphySearch.handleGifDetailByCover.call(this,event);
}).on("dragstart", ".giphy_gif_li", function(event) {
//GiphySearch.handleGIFDragFFFix.call(this, event);
}).on("dragstart", "#gif-detail-gif", function(event){
//GiphySearch.handleGIFDrag.call(this, event);
}).on("dragstart", ".gif-detail-cover", function(event){
//GiphySearch.handleGIFDragDetailFFFix.call(this, event);
}).on("click", "#categories .popular_tag", function(event) {
GiphySearch.handleTag.call(this,event);
});
jQuery("#app").on("click", ".logo-text", function(event) {
GiphySearch.handleTrendingHome.call(this,event);
}).on("click", ".logo-image", function(event) {
GiphySearch.handleTrendingHome.call(this,event);
});
// address 'home' via logo tag
jQuery("#header").on("click", function(event) {
});
// search input handler
jQuery("#searchbar-input").keypress(function(event) {
////console.log("search bar input");
if(event.keyCode == 13) {
GiphySearch.handleSearch.call(this,event);
}
});
// search button handler
jQuery("#search-button").on("click", function(event) {
//console.log("search button");
GiphySearch.handleSearch.call(this,event);
});
// categories handler
jQuery("#categories-button").on("click", function(event) {
//console.log("categories button");
GiphySearch.handleCategories.call(this,event);
});
// back button handler
jQuery("#back-button").on("click", function(event) {
GiphySearch.handleBack.call(this,event);
});
//console.log("end bind events");
//console.log(jQuery("#categories-button"));
},
is_ext:function() {
return !!(window.chrome && chrome.contextMenus);
},
init_firefox_extension:function() {
GiphySearch.STILL_SCROLL_PAGES = 3;
//console.log("init_firefox_extension();");
jQuery(".ff_window_close_btn").bind("click", function(e) {
window.close();
});
},
init_chrome_extension:function() {
GiphySearch.PLATFORM_COPY_PREPEND_TEXT = "Copy to clipboard: ";
// GiphySearch.search("giphytrending", 100, true);
GiphySearch.ALLOW_URL_UPDATES = false;
GiphySearch.STILL_SCROLL_PAGES = 3;
window.unonload = function() {
//console.log("closed!");
// chrome.contextMenus.removeAll();
}
jQuery("#container").on("click", "#gif-detail-link", function(event) {
// copy to clipboard..
var $this = jQuery(this);
var _input = newT.input({
type:"text",
id:"giphy_copy_box",
value:$this.data("shortlink")
});
jQuery("#giphy_copy_box").remove();
jQuery(document.body).append(_input);
document.getElementById("giphy_copy_box").select();
document.execCommand('Copy', false, null);
});
var protocol_exp = /([https|http|ftp]+:)\/\//;
var hostname_exp = /\/\/([^\/]+)\/?/;
function urlparse(_url) {
var params = {};
var m1 = _url.match(protocol_exp);
if(m1 && m1.length > 1) {
params.scheme = m1[1];
}
var m2 = _url.match(hostname_exp);
if(m2 && m2.length >1) {
params.hostname = m2[1];
}
return params;
}
GiphySearch.render_completed = function() {
// //console.log("foo!");
jQuery("#searchbar-input").focus();
}
// load chrome!
chrome.contextMenus.create({
"id":"giphy_context_menu",
"title" : "Copy Link address",
"type" : "normal",
"contexts" : ["image"] //the context which item appear
});
chrome.contextMenus.create({
"id":"giphy_img_src_menu",
"title" : "Copy Full Size GIF Image",
"type" : "normal",
"contexts" : ["image"] //the context which item appear
});
chrome.windows.getCurrent(function(_win) {
chrome.tabs.query({ currentWindow: true, active: true }, function (tabs) {
GiphySearch.location = urlparse(tabs[0].url);
});
});
// setup the right click to work...
chrome.contextMenus.onClicked.addListener(function(info, tab) {
// lookup the context
// //console.log("context menu!", info, info.srcUrl, GiphySearch.curResponse, GiphySearch.find_by_src(info.srcUrl));
// TODO POSSIBLE ERROR here
var gif_obj = GiphySearch.find_by_src(info.srcUrl);
if(!gif_obj) {
//console.log("NO SUCH GIF!");
gif_obj = GiphySearch.curResponse.data[0];
// return; // BAIL out
}
var elem_params = {
type:"text",
id:"giphy_copy_box",
value:info.srcUrl
};
// //console.log("info.menuItemId", info.menuItemId);
if(info.menuItemId === "giphy_img_src_menu") {
// //console.log("Using", gif_obj.images.original.url);
elem_params.value = gif_obj.images.original.url;
} else {
// //console.log("Using", gif_obj.bitly_gif_url);
elem_params.value = gif_obj.bitly_gif_url;
}
var div = newT.input(elem_params);
// jQuery("#giphy_copy_box").val( elem_params.value ).select()
// jQuery("#giphy_copy_box").val( info.srcUrl );
jQuery("#giphy_copy_box").remove(); // kill existing
jQuery(document.body).append(div);
document.getElementById("giphy_copy_box").select();
document.execCommand('Copy', false, null);
setTimeout(function() {
},0);
});
},
find_by_src:function(src_url) {
var all_gifs = [];
var selected = null;
if(GiphySearch.prevResponse) {
all_gifs.push.apply(all_gifs,GiphySearch.prevResponse.data);
}
if(GiphySearch.curResponse) {
all_gifs.push.apply(all_gifs,GiphySearch.curResponse.data);
}
// var data = GiphySearch.curResponse;
for(var i=0, len=all_gifs.length; i<len; i++) {
if(all_gifs[i].images.fixed_width.url === src_url) {
selected = all_gifs[i];
break;
}
}
all_gifs = [];
return selected;
},
format:function(str,params) {
return str.replace(/%\((\w+)\)s/g, function(m, key) {
return params[key] || ""
});
},
/**
Handlers definitions
handle all the events
this is a hodge-podge
some of the events call sub methods, others
are defined top level
*/
handleGIFDragDetailFFFix:function(e) {
//console.log("Handle FF drag");
var dt = e.originalEvent.dataTransfer;
var $this = jQuery(this).parent("div").find("img");
// var _id = $this.data("id");
var _hostname = GiphySearch.location.hostname;
var gif_obj = GiphySearch.find_by_src( $this.attr("src") );
// //console.log("found gif!", gif_obj);
if(!gif_obj) {
//console.log("no such GIF", gif_obj);
return;
}
dt.dropEffect = "copy";
dt.effectAllowed = "copy";
// dt.dropEffect= 'move';
// dt.effectAllowed = "copyMove"
var htmlstr = GiphySearch.gmail_template( {
src:gif_obj.images.original.url,
url:gif_obj.bitly_gif_url
});
// dt.effectAllowed = "move";
// dt.dropEffect = "move";
dt.setData("text/html", htmlstr);
dt.setData("text", htmlstr);
// dt.setData("text/html", "foobar");
// dt.setData("text", "foobar");
//console.log("setting data", dt.getData("text"));
if(_hostname === "twitter.com") {
dt.setData("text/html", gif_obj.bitly_gif_url + " via @giphy" );
}
if(_hostname === "www.facebook.com") {
dt.effectAllowed = "linkMove";
dt.dropEffect = "linkMove";
// FB pukes on our short link. use full url for better user experience
dt.setData("text/html", "http://giphy.com/gifs/" + gif_obj.id );
dt.setData("text", "http://giphy.com/gifs/" + gif_obj.id );
}
if(/.*\.hipchat\.com/.test(_hostname)) {
dt.setData("text/html", gif_obj.images.original.url);
dt.setData("text", gif_obj.images.original.url);
}
},
handleGIFDragFFFix:function(e) {
//console.log("Handle FF drag");
var dt = e.originalEvent.dataTransfer;
var $this = jQuery(this).find("img");
// var _id = $this.data("id");
var _hostname = GiphySearch.location.hostname;
var gif_obj = GiphySearch.find_by_src( $this.attr("src") );
// //console.log("found gif!", gif_obj);
if(!gif_obj) {
//console.log("no such GIF", gif_obj);
return;
}
dt.dropEffect = "copy";
dt.effectAllowed = "copy";
// dt.dropEffect= 'move';
// dt.effectAllowed = "copyMove"
var htmlstr = GiphySearch.gmail_template( {
src:gif_obj.images.original.url,
url:gif_obj.bitly_gif_url
});
// dt.effectAllowed = "move";
// dt.dropEffect = "move";
dt.setData("text/html", htmlstr);
dt.setData("text", htmlstr);
// dt.setData("text/html", "foobar");
// dt.setData("text", "foobar");
//console.log("setting data", dt.getData("text"));
if(_hostname === "twitter.com") {
dt.setData("text/html", gif_obj.bitly_gif_url + " via @giphy" );
}
if(_hostname === "www.facebook.com") {
dt.effectAllowed = "linkMove";
dt.dropEffect = "linkMove";
// FB pukes on our short link. use full url for better user experience
dt.setData("text/html", "http://giphy.com/gifs/" + gif_obj.id );
dt.setData("text", "http://giphy.com/gifs/" + gif_obj.id );
}
if(/.*\.hipchat\.com/.test(_hostname)) {
dt.setData("text/html", gif_obj.images.original.url);
dt.setData("text", gif_obj.images.original.url);
}
},
handleGIFDrag:function(e) {
//console.log("I am dragging!", e);
// e.preventDefault();
// e.stopPropagation();
// jQuery('.dropzone').hide().removeClass('dropzone-hilight');
var dt = e.originalEvent.dataTransfer;
var $this = jQuery(this);
// var _id = $this.data("id");
var _hostname = GiphySearch.location.hostname;
var gif_obj = GiphySearch.find_by_src( $this.attr("src") );
// //console.log("found gif!", gif_obj);
if(!gif_obj) {
//console.log("no such GIF", gif_obj);
return;
}
dt.dropEffect = "copy";
dt.effectAllowed = "copy";
// dt.dropEffect= 'move';
// dt.effectAllowed = "copyMove"
var htmlstr = GiphySearch.gmail_template( {
src:gif_obj.images.original.url,
url:gif_obj.bitly_gif_url
});
// dt.effectAllowed = "move";
// dt.dropEffect = "move";
dt.setData("text/html", htmlstr);
dt.setData("text", htmlstr);
// dt.setData("text/html", "foobar");
// dt.setData("text", "foobar");
//console.log("setting data", dt.getData("text"));
if(_hostname === "twitter.com") {
dt.setData("text/html", gif_obj.bitly_gif_url + " via @giphy" );
}
if(_hostname === "www.facebook.com") {
dt.effectAllowed = "linkMove";
dt.dropEffect = "linkMove";
// FB pukes on our short link. use full url for better user experience
dt.setData("text/html", "http://giphy.com/gifs/" + gif_obj.id );
dt.setData("text", "http://giphy.com/gifs/" + gif_obj.id );
}
if(/.*\.hipchat\.com/.test(_hostname)) {
dt.setData("text/html", gif_obj.images.original.url);
dt.setData("text", gif_obj.images.original.url);
}
},
handleSearch: function(event) {
////console.log("handleSearch()");
// get the tag to search
var tag = jQuery("#searchbar-input").val();
if(tag == "") return;
// don't reset the typed in input!
GiphySearch.scrollTimer = 0;
GiphySearch.searchTimer = 0;
GiphySearch.curY = 0;
GiphySearch.curOffset = 0;
// reset the scroll and page vars
// GiphySearch.resetSearch();
// make the new search
GiphySearch.show_preloader();
GiphySearch.search(tag, GiphySearch.SEARCH_PAGE_SIZE, true);
GiphySearch.navigate("gifs");
},
handleTrendingHome:function(event) {
GiphySearch.show_preloader();
GiphySearch.resetSearch();
GiphySearch.search("giphytrending", 100, true);
GiphySearch.navigate("gifs");
// GiphySearch.add_history( "Giphy", "/" );
},
handleTag: function(event) {
////console.log("handleTag()");
// get the tag
var tag = jQuery(event.target).text();
if(tag == '') return;
GiphySearch.show_preloader();
GiphySearch.resetViewport();
GiphySearch.updateSearch( tag );
// reset the scroll and page vars
// GiphySearch.resetSearch();
// make the new search
GiphySearch.search(tag, GiphySearch.SEARCH_PAGE_SIZE, true);
GiphySearch.navigate("gifs");
// isolate all these,
// restrict to a flag
// GiphySearch.add_history( "Giphy Gif Search", "/search/" + tag.replace(/\s+/g, '-') );
},
handleGifDetailByCover:function(event) {
var gif = jQuery(event.target).parent(".giphy_gif_li").find("img");
GiphySearch._opendetail( gif );
},
handleGifDetail: function(event) {
//console.log("handleGifDetail()");
// get the fullsize gif src
var gif = jQuery(event.target);
GiphySearch._opendetail( gif );
},
_opendetail:function(gif) {
//jQuery("html, body").animate({ scrollTop: 0 }, "fast");
window.scrollTo(0, 0);
jQuery("#container").css("overflow", "hidden");
var gifEl = jQuery("#gif-detail-gif");
// var loader = jQuery("#loader");
var animatedLink = gif.attr("data-animated");
var staticLink = gif.attr("data-still");
gifEl.attr("src", staticLink);
gifEl.attr("data-id", gif.attr("data-id"));
gifEl.attr("data-width", "500");
gifEl.attr("data-height", Math.floor(gif.attr("height") * 2.5));
// show the loader
// loader.css("display","block");
GiphySearch.show_preloader();
jQuery("<img />").attr("src", animatedLink).load(function(e){
// //console.log("load event", this.naturalHeight, this.clientWidth)
GiphySearch.hide_preloader();
// loader.css("display","none");
gifEl.attr("src", animatedLink);
// height:gif.attr("original_height")
jQuery(".gif-detail-cover").css({
height:jQuery("#gif-detail-gif").height()
}).attr("draggable", true);
});
var linkHTML = "<span class='gif-link-info'>" + GiphySearch.PLATFORM_COPY_PREPEND_TEXT+""+ gif.attr("data-shortlink")+"</span>";
var tags = gif.attr("data-tags").split(',');
var tagsHTML = "";
jQuery(tags).each(function(idx, tag){
if(tag !== ""){
tagsHTML += "<span class='gif-detail-tag'>"+tag+"</span>"; //USE ACTUAL ENCODDed?
}
});
jQuery("#gif-detail-link").html(linkHTML).attr({
"data-shortlink":gif.attr("data-shortlink") // we should call this data the same name as the server does
});
jQuery("#gif-detail-tags").html(tagsHTML);
jQuery(".gif-detail-tag").on("click", function(event) {
GiphySearch.handleTag(event);
});
// GiphySearch.add_history( "Giphy", "/gifs/"+gif.attr("data-id") );
GiphySearch.navigate("gif-detail");
},
handleCategories: function(event) {
////console.log("handleCategories()");
event.preventDefault();
GiphySearch.navigate("categories");
},
handleBrowserNavigation: function(event){
/*
* UPDATE SO TO NOT MAKE NEW SEARCH CALLS WHen
*/
var pathHash = window.location.pathname.split('/');
if(pathHash[1] != "") {
if(pathHash[1] == "gifs"){
GiphySearch.navigate("gif-detail", pathHash[2]);
}
if(pathHash[1] == "search"){
GiphySearch.search(pathHash[2], 100, true);
GiphySearch.navigate("gifs");
}
} else {
GiphySearch.search("giphytrending", 100, true);
GiphySearch.navigate("gifs");
}
},
handleBack: function(event) {
jQuery("#container").css("overflow", "auto");
// no back on the gifs page
if(GiphySearch.curPage == "gifs") { return; }
// back to the gif page
if(GiphySearch.curPage == "categories" ||
GiphySearch.curPage == "gif-detail") {
// GiphySearch.add_history("Giphy", "/");
GiphySearch.navigate("gifs");
}
},
navigate: function(page, data) {
//console.log("navigate(" + page + "," + data + ")");
// set the current page
GiphySearch.curPage = page;
// hide everything
jQuery("#gifs,#gif-detail,#share-menu,#categories,#category,#back-button").hide();
// show the footer... it goes away on the gif-detail
jQuery("#footer").show();
// gifs
if(page == "gifs") {
jQuery("#gifs").show();
}
// gif detail
if(page == "gif-detail") {
jQuery("#gif-detail,#back-button,#share-menu").show();
jQuery("#footer").hide();
}
// categories
if(page == "categories") {
//console.log("showing back button");
jQuery("html, body").animate({ scrollTop: 0 }, "fast");
jQuery("#categories,#back-button").show();
}
// category
if(page == "category") {
jQuery("#category").show();
}
},
orientationchange: function(event) {
//console.log("orientationchange()");
},
scroll: function(event) {
////console.log("scroll()");
// only scroll on gifs page
if(GiphySearch.curPage != "gifs") return;
// set the current scroll pos
GiphySearch.prevScrollPos = GiphySearch.curScrollPos;
GiphySearch.curScrollPos = jQuery(event.target).scrollTop() + jQuery(window).height();
// infinite scroll
if(GiphySearch.curScrollPos + GiphySearch.INFINITE_SCROLL_PX_OFFSET > jQuery("#gifs").height()) {
// start the infinite scroll after the last scroll event
clearTimeout(GiphySearch.searchTimer);
GiphySearch.searchTimer = setTimeout(function(event) {
GiphySearch.search(GiphySearch.curSearchTerm, GiphySearch.INFINITE_SCROLL_PAGE_SIZE, false);
}, 250);
}
// compenstate for a double scroll end event being triggered
clearTimeout(GiphySearch.scrollTimer);
GiphySearch.scrollTimer = setTimeout(function() {
GiphySearch.scrollend(event);
}, GiphySearch.SCROLLTIMER_DELAY);
},
scrollstart: function(event) {
////console.log("scrollstart()");
},
scrollend: function(event) {
if(GiphySearch.renderTimer) { clearTimeout(GiphySearch.renderTimer); }
GiphySearch.renderTimer = setTimeout(function() {
GiphySearch.render();
}, 250);
},
hide_preloader:function() {
//console.log("hide preloader");
jQuery(".loading_icon_box,.loading_icon").css("display","none");
},
show_preloader:function() {
//console.log("show preloader");
jQuery(".loading_icon_box,.loading_icon").css("display","block");
},
// THIS IS POORLY NAMED, it doesn't render, it displays..
// renders (aka added to DOM happens WAY earlier)
render: function() {
if(GiphySearch.isRendering) return;
GiphySearch.isRendering = true;
//console.log("*** render() ***");
//console.log("*** display() ***");
// get all the gifs
/**
NOTE:
lis ONLY has a length
when there are ALREADY rendered items
on the page
this is related to using setTimeout
when adding images to masonry / DOM
*/
var lis = jQuery("#gifs li");
// calculate the window boundaries
var windowTop = jQuery(window).scrollTop();
var windowBottom = windowTop + jQuery(window).height();
var windowHeight = jQuery(window).height();
// sliding window of animated, still, and off
////console.log("existing li : ", lis);
////console.log("rendering " + lis.length + " num lis");
for(var i=0; i<lis.length; i++) {
// get the gif
var li = jQuery(lis.get(i));
// try cooperative multitasking to let the graphics render have a moment
// this seems super innefficient b/c we access the DOM a LOT
(function($li, _pos) {
setTimeout(function() {
// need to calculate the window offsets and some emperical padding numbers
var liTop = $li.offset().top;
var liBottom = liTop + $li.height();
var img = $li.find("img");
var liHeightOffset = GiphySearch.ANIMATE_SCROLL_PX_OFFSET;
var stillPagesOffset = GiphySearch.STILL_SCROLL_PAGES;
////console.log("GIF ON " , windowTop, liHeightOffset, liBottom, windowBottom);
// turn on the gifs that are in view... we pad with an offset to get the edge gifs
if((liTop >= windowTop - liHeightOffset) && (liBottom <= windowBottom + liHeightOffset)) {
// if((liTop >= windowTop - liHeightOffset) && (liBottom <= windowBottom + liHeightOffset)) {
////console.log("GIF ON " , windowTop, liHeightOffset, liBottom, windowBottom);
// buffer the animated gifs with a page above and below of stills...
// pad these a big with multiples of the window height
jQuery(img).attr("src", jQuery(img).attr("data-animated"));
// jQuery(img).attr("src", $img.attr("data-downsampled"));
} else if((liTop >= windowTop - windowHeight*stillPagesOffset) &&
(liBottom <= windowBottom + windowHeight*stillPagesOffset)) {
////console.log("GIF STILL");
// still these gifs
jQuery(img).attr("src", jQuery(img).attr("data-still"));
} else {
////console.log("GIF OFF");
// clear the rest of the gifs
if(GiphySearch.is_ext()) {
jQuery(img).attr("src", jQuery(img).attr("data-still") );
} else {
////console.log("setting img src to clear");
jQuery(img).attr("src", "img/clear.gif");
}
}
if(lis.length-1 === _pos) {
GiphySearch.render_completed();
// //console.log(i, "current possition", lis.length)
}
}, 0)})( jQuery(li), i );
}
// reset rendering
GiphySearch.isRendering = false;
GiphySearch.hide_preloader();
//console.log("rendering completed", "is rendering", GiphySearch.isRendering, lis.length);
},
gmail_template:function(params) {
// we paste this 'template' into the dragdrop datatranser object
return GiphySearch.format( '<a href="%(url)s"><img src="%(src)s" border="0" /></a><br />via <a href="%(url)s">giphy.com</a>', params );
},
render_completed:function() {
//console.log("done rendering now!");
},
updateSearch:function(txt) {
jQuery("#searchbar-input").val(txt);
},
resetViewport:function() {
GiphySearch.scrollTimer = 0;
GiphySearch.searchTimer = 0;
GiphySearch.curY = 0;
GiphySearch.curOffset = 0;
},
resetSearch: function() {
////console.log("resetSearch()");
// reset the search box
// jQuery("#searchbar-input").blur();
jQuery("#searchbar-input").val("");
// reset the scroll params
GiphySearch.resetViewport();
},
process_search_response:function(response) {
//console.log("fetched API data", response)
// set the current search term
// parse the gifs
var gifs = response.data;
var elem_array = [];
var _frag = document.createDocumentFragment();
//console.log("process search response ", _frag);
//console.log("gifs length = " + gifs.length);
for(var i=0; i<gifs.length; i++) {
////console.log("i = " + i);
var gif = gifs[i];
var tags = gif.tags || [];
var gifTags = newT.frag();
var _dataTags = [];
// TODO: make this a function
if(tags) {
for(var j=0; j<tags.length && j<GiphySearch.MAX_TAGS; j++) {
if(tags[j].indexOf('giphy') == -1){
gifTags.appendChild(newT.span({
clss:"tag"
}, tags[j]));
_dataTags.push( tags[j] );
}
}
}
var dataTags = _dataTags.join(",")
var gif_height = Math.floor((gif.images.fixed_width.height * GiphySearch.MAX_GIF_WIDTH / gif.images.fixed_width.width));
var _li = newT.li({
clss:"giphy_gif_li",
draggable:true
},
newT.img({
// draggable:true,
clss:"gif giphy_gif",
height:gif_height,
original_height:gif.images.fixed_width.height,
"data-id":gif.id,
"data-animated":gif.images.fixed_width.url,
"data-downsampled":gif.images.fixed_height_downsampled.url,
"data-still":gif.images.fixed_width_still.url,
"data-tags":dataTags,
"data-shortlink":gif.bitly_gif_url,
src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
}),
newT.div({
clss:"tags"
}, newT.div({
clss:"tags_inner"
},gifTags)),
newT.div({
clss:"actions"
},newT.a({
href:"#"
})),
newT.div({
clss:"gif_drag_cover",
style:"height:" + gif_height + "px;"
})
);
////console.log(_li);
_frag.appendChild(_li);
elem_array.push(_li)
// increment the num gifs
GiphySearch.curGifsNum++; // why? really seriously why?
}
//console.log("element array = ", elem_array.length);
// when I call settimout, the page no longer loads - WHY? no lis..
//var gifs = document.getElementById("gifs");
var gifs = jQuery('ul#gifs');
document.getElementById("gifs").appendChild(_frag);
//console.log('calling masonry with ', elem_array.length, gifs);
gifs.masonry('appended', elem_array, true);
//console.log("post append");
},
search: function(q, limit, reset) {
//console.log("search : " + q + " limit = " + limit + " reset = " + reset);
// if we are searching, bail on scroll
// are we a new search vs infinite scroll then reset the gif count
if(reset) {
GiphySearch.curGifsNum = 0;
jQuery('#gifs').empty();
}
GiphySearch.show_preloader();
// save the current and previous search terms
GiphySearch.prevSearchTerm = GiphySearch.curSearchTerm;
GiphySearch.curSearchTerm = q;
// giphy search api url
var url = "http://api.giphy.com/v1/gifs/search?api_key=" + GiphySearch.API_KEY +
"&q=" + q +
//"&type=min" +
"&limit=" + limit +
"&offset=" + GiphySearch.curGifsNum;
// make the ajax call
var xhr = jQuery.ajax({
dataType: "json",
url: url
});
xhr.done(function(resp) {
////console.log("xhr done " + resp);
// skip prev responses
if(GiphySearch.curResponse == resp) { return; }
GiphySearch.curSearchTerm = q;
GiphySearch.curLimit = limit;
// set the previous response to keep out old data
GiphySearch.prevResponse = GiphySearch.curResponse;
GiphySearch.curResponse = resp;
// if this is reset then swap ou
if(reset) {
jQuery("#gifs").empty();
jQuery("#gifs").masonry();
}
setTimeout(function() {
GiphySearch.process_search_response(resp);
GiphySearch.render();
},0)
})
.fail(function(resp) {
alert( "error communicating with giphy api! try again later." );
});
return xhr;
}
}

View File

@@ -0,0 +1,24 @@
var GiphyCMSExt = {
init: function() {
jQuery('#gif-inject-cms').html('<button class="button button-hero" onclick="GiphyCMSExt.doTinyMCEEmbed()">Embed into post</button>');
},
doTinyMCEEmbed: function() {
console.log("doTinyMCEEmbed");
var embedId = jQuery('img#gif-detail-gif').attr('data-id');
var width = jQuery('img#gif-detail-gif').width();
var height = jQuery('img#gif-detail-gif').height();
var gifToEmbed = jQuery('img#gif-detail-gif').attr('src');
var uri = '<img src="' + gifToEmbed + '">';
//parent.tinyMCE.activeEditor.execCommand("mceInsertRawHTML", false, uri);
parent.tinyMCE.activeEditor.execCommand("mceInsertContent", false, uri);
parent.tinyMCE.activeEditor.selection.select(parent.tinyMCE.activeEditor.getBody(), true); // ed is the editor instance
parent.tinyMCE.activeEditor.selection.collapse(false);
parent.tinyMCE.activeEditor.windowManager.close(window);
}
};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,18 @@
jQuery(document).ready(function() {
jQuery('#gifs').masonry({
itemSelector: '#gifs li',
columnWidth: 145,
gutter: 10,
transitionDuration: '0.2s',
isFitWidth: true
});
// init giphy
GiphySearch.init();
// init the CMS extension app
GiphyCMSExt.init();
// start the default search
GiphySearch.search("giphytrending", 100, true);
});

View File

@@ -0,0 +1,7 @@
/*!
* jQuery-ajaxTransport-XDomainRequest - v1.0.1 - 2013-10-17
* https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest
* Copyright (c) 2013 Jason Moon (@JSONMOON)
* Licensed MIT (/blob/master/LICENSE.txt)
*/
(function($){if(!$.support.cors&&$.ajaxTransport&&window.XDomainRequest){var n=/^https?:\/\//i;var o=/^get|post$/i;var p=new RegExp('^'+location.protocol,'i');var q=/text\/html/i;var r=/\/json/i;var s=/\/xml/i;$.ajaxTransport('* text html xml json',function(i,j,k){if(i.crossDomain&&i.async&&o.test(i.type)&&n.test(i.url)&&p.test(i.url)){var l=null;var m=(j.dataType||'').toLowerCase();return{send:function(f,g){l=new XDomainRequest();if(/^\d+$/.test(j.timeout)){l.timeout=j.timeout}l.ontimeout=function(){g(500,'timeout')};l.onload=function(){var a='Content-Length: '+l.responseText.length+'\r\nContent-Type: '+l.contentType;var b={code:200,message:'success'};var c={text:l.responseText};try{if(m==='html'||q.test(l.contentType)){c.html=l.responseText}else if(m==='json'||(m!=='text'&&r.test(l.contentType))){try{c.json=$.parseJSON(l.responseText)}catch(e){b.code=500;b.message='parseerror'}}else if(m==='xml'||(m!=='text'&&s.test(l.contentType))){var d=new ActiveXObject('Microsoft.XMLDOM');d.async=false;try{d.loadXML(l.responseText)}catch(e){d=undefined}if(!d||!d.documentElement||d.getElementsByTagName('parsererror').length){b.code=500;b.message='parseerror';throw'Invalid XML: '+l.responseText;}c.xml=d}}catch(parseMessage){throw parseMessage;}finally{g(b.code,b.message,c,a)}};l.onprogress=function(){};l.onerror=function(){g(500,'error',{text:l.responseText})};var h='';if(j.data){h=($.type(j.data)==='string')?j.data:$.param(j.data)}l.open(i.type,i.url);l.send(h)},abort:function(){if(l){l.abort()}}}}})}})(jQuery);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,401 @@
/*
newT
a JavaScript template library
authors: jeffrey tierney | https://twitter.com/jeffreytierney
gregory tomlinson | https://twitter.com/gregory80
project home: https://github.com/jeffreytierney/newT
license: (see author)
Usage:
Create a new 'newT' -- a JS represention of DOM Template w/ event capabilities
newT.save("id_name", function( data ) {
// use the () for multiline return of DOM elements via newT.
// the second param is the 'contents' of the element
// this sample is a simple string derived from data when newT.render() is called
return (
newT.div({clss : "my_css_class"}, data.foo)
)
});
Converter syntax for Element CSS Class Attribute: "clss"
Render DOM Elements
@param string "id_name" template name
@param (any) the data to pass to the method used in the second parameter of newT.save("name", func);
newT.render("id_name", { foo : "hello world bars" } );
Render DOM with options and scope
newT.render("id_name", {}, {
scope : obj_scope || this
data : { } // will be overriden completely - not extended
preData : func // execute w/ scope passed in
pre : func // excuted w/ scope passed in
})
On Script Load
On script load, the newT (or temp name is assigned) is initialized.
This single instance allows convience referrals to complex structures through the
newT iterface
Use with innerHTML
newT.renderToString("id_name", {
foo : "I come back as a string, no a DOM node"
});
Iteration
newT.each(["one", "two"], function( data, idx ) {
console.log("data", data);
console.log("index position", idx);
})
Innards:
newT.templates.global will provide current "templates"
*/
(function (temp) {
// Default global var name will be newT
// can be overridden by passing something different
// into the self executing wrapper function
temp = temp || "newT";
// internally refer to it as T for brevity sake
var T = function(options) {
this.init(options || {});
}, regex_pattern=/\<[^\>]+\>|\&[^ ]+;/,
el_cache = {},
slice = Array.prototype.slice;
T.prototype = {
constructor: T.prototype.constructor,
version : "1.1.2",
init: function(options) {
this.options = {
if_attr: "when",
local_safe: "_safe",
safe_mode: true
};
for(var opt in options) { this.options[opt] = options[opt]; }
this.templates = {};
this.__createMethods();
return this;
},
// simple function to save the passed in template
save: function(name, template) {
var name_parts = name.split("."),
ns = "global";
name = name_parts[0];
if(name_parts.length > 1) {
ns = name_parts[1];
}
if(!this.templates.hasOwnProperty(ns)) { this.templates[ns] = {}; }
this.templates[ns][name] = template;
return this;
},
// create the elements for the template
// and if an exisiting root el was passed in, append it to that root
// either way, return the newly created element(s)
render: function(name, data, opts) {
var name_parts = name.split("."),
ns = "global",
new_el,
ret,
_new_el, i;
name = name_parts[0];
if(name_parts.length > 1) {
ns = name_parts[1];
}
opts = opts || {};
opts.scope = opts.scope || null;
opts.data = data;
// if a preprocessing function is specified in the options, call it
// use either the specified scope, or the default of null (set earlier)
// params
if (opts.preData) { opts.data = opts.preData.call(opts.scope, opts.data); }
if (opts.pre) { ret = opts.pre.call(opts.scope, opts.data); }
this.cur_options = opts;
new_el = this.templates[ns][name](opts.data, opts._i, opts._idx);
if(typeof new_el === "object" && new_el.constructor === [].constructor) {
_new_el=new_el;
new_el=document.createDocumentFragment();
for(i in _new_el) {
new_el.appendChild( _new_el[i] );
}
}
if(opts.el) {
opts.el.appendChild(new_el);
}
// if a posprocessing function is specified in the options, call it
// use either the specified scope, or the default of null (set earlier)
if (opts.post) { opts.post.call(opts.scope, new_el, opts.data); }
this.cur_options = null;
delete opts;
return new_el;
},
renderToString: function(name, data, opts) {
opts = opts || {};
delete opts.el;
var el = document.createElement("div");
el.appendChild(this.render(name, data, opts));
return el.innerHTML;
},
// function to iterate over a collection and render a previously saved template
// for each item in the collection
// uses a document fragment to collect each element and pass it back
eachRender: function(data, template_name, opts) {
// dont set cur_options here because that happens in render
opts = opts || {};
if(!this.checkRender(opts)) { return ""; }
var frag = document.createDocumentFragment(), idx=0, i;
opts.el = frag;
for(i in data) {
if(data.hasOwnProperty(i)) {
opts["_i"] = i;
opts["_idx"] = idx++;
this.render(template_name, data[i], opts);
}
}
delete opts;
return frag;
},
// more free form iterator function that allows passing an ad-hoc
// rendering function to be evaluated for each item in the collection
// uses a document fragment to collect each element and pass it back
each: function(data, func, opts) {
opts = opts || {};
if(!this.checkRender(opts)) { return ""; }
this.cur_options = opts;
var frag = document.createDocumentFragment(), child, idx=0, i;
for(i in data) {
if(data.hasOwnProperty(i)) {
child = func(data[i], i, idx);
if(child) {
frag.appendChild(child);
}
idx+=1;
}
}
this.cur_options = null;
return frag;
},
checkRender: function(opts) {
if(this.options.if_attr in opts && !opts[this.options.if_attr]) { return false; }
return true;
},
// function that gets called in initializing the class... loops through
// list of allowed html elements, and creates a helper function on the prototype
// to allow easy creation of that element simply by calling its name as a function
__createMethods: function() {
//var el_list = "a abbr acronym address applet area b base basefont bdo bgsound big blockquote body br button caption center cite code col colgroup comment custom dd del dfn dir div dl dt em embed fieldset font form frame frameset head h1 h2 h3 h4 h5 h6 hn hr html i iframe img input input ins isindex kbd label legend li link listing map marquee menu meta nobr noframes noscript object ol optgroup option p param plaintext pre q rt ruby s samp script select small span strike strong style sub sup table tbody td textarea tfoot th thead title tr tt u ul var wbr xml xmp video audio";
var el_list = "a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup command datalist dd del details device dfn div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd keygen label legend li link map mark menu meta meter nav noscript object ol optgroup option output p param pre progress q rp rt ruby s samp script section select small source span strong style sub summary sup table tbody td textarea tfoot th thead time title tr track ul var video wbr",
els = el_list.split(" "),
prefix = this.options.prefix || "", _this = this;
// extra helper for just grouping a bunch together without a specific parent
els.push("frag");
this.addEls(els, true);
return this;
},
_createEl: function(type) {
if (type in el_cache && el_cache[type].cloneNode) { return el_cache[type].cloneNode(false);}
el_cache[type] = document.createElement(type);
return el_cache[type].cloneNode(false);
},
// generic version of the function used to build the element specific creation functions
// type -> name of element to create
// attributes (optional) -> object with key/value pairs for attributes to be added to the element
// to avoid silliness with using class as an object key
// you must use "clss" to set class. yuck
// content (optional) -> arbitrarily many pieces of content to be added within the element
// can be strings, domElements, or anything that evaluates to either of those
element: function(type, attributes, content) {
var args = slice.call(arguments, 1),
el = (type==="frag" ? document.createDocumentFragment() : this._createEl(type));
if(args.length) {
content = args;
}
else {
return el;
}
if (args[0] && args[0].toString() === "[object Object]") {
attributes = content.shift();
}
else {
attributes = null;
}
if(attributes) {
// when is not an attribute... but can accept a test case that can be used for conditional rendering
// if it evaluates to true, the node will be rendered... if not, rendering will be short-circuited and an empty string will be returned
// when is now just the default value for if_attr... this can be overridden using setOption()
var _local_safe_mode;
if(!this.checkRender(attributes)){ el = null; return "";}
delete attributes[this.options.if_attr];
if(this.options.local_safe in attributes) {
_local_safe_mode = !!attributes[this.options.local_safe];
delete attributes[this.options.local_safe];
}
for(attr in attributes) {
switch(attr.toLowerCase()) {
case "clss":
case "classname":
el.className = (attributes[attr].join ? attributes[attr].join(" ") : attributes[attr]);
break;
case "style":
el.cssText = el.style.cssText = attributes[attr];
break;
default:
if(attr.charAt(0) === "_") {
var attr_name = attr.substring(1);
if(attributes[attr]) {
el.setAttribute(attr_name, attr_name);
}
}
else{
el.setAttribute(attr, attributes[attr]);
}
}
}
}
var c;
for(var i=0, len=content.length; i<len; i++) {
// if the content is a string, create a Text Node to hold it and append
// unless (for now) there are html tags or entities in it... then just innerHTML it
c = content[i];
switch(typeof c) {
case "string":
this.addText(el, c, _local_safe_mode);
break;
case "number":
el.appendChild(document.createTextNode(c));
break;
case "function":
var result = c();
if(typeof result == "string") {
this.addText(el, result, _local_safe_mode);
}
else {
el.appendChild(result);
}
break;
case "undefined":
break;
default:
try{ el.appendChild(c); } catch(ex) { el.appendChild(document.createTextNode(c)); }
break;
}
}
return el;
},
addText: function(el, text, _local_safe_mode) {
if(!this.isSafeMode(_local_safe_mode) && text.match(regex_pattern)) {
el.innerHTML = text;
}
else {
el.appendChild(document.createTextNode(text));
}
return this;
},
setOption: function(key, val){
if (typeof key === "object") {
for (var _key in key) { this.options[_key] = key[_key]; }
}
else {
this.options[key] = val;
}
return this;
},
// when safe mode is set to on, any strings
safeMode: function(on) {
if(typeof on == "undefined") { on = true; }
this.options["safe_mode"] = !!on;
return this;
},
isSafeMode: function(_local_safe_mode) {
if(typeof _local_safe_mode != "undefined") { return !!_local_safe_mode; }
if (this.cur_options && "safe_mode" in this.cur_options) { return !!this.cur_options.safe_mode; }
return !!this.options.safe_mode
},
// If you want another separate instance of newT, perhaps to keep its own template management
// call newT.clone() and it will return another freshly initialized copy (with a clear templates object)
clone: function(options) {
return new T(options);
},
// want to write plugin elements that can do more than just render dom elements?
// such as dom elements that have some extra processing or ajax requests related to their rendering
// extend the core newT prototype with this method.
extend: function(name, func, force, local) {
if(local) {
if(!this.hasOwnProperty(name) || force) {
this[name] = func;
return true;
}
}
else {
if(!(name in T.prototype) || force) {
T.prototype[name] = func;
return true;
}
}
return false;
},
addEls: function(els, force, local) {
if(typeof els === "string") { els = els.split(" "); }
var _this = this, args, p_elem=T.prototype.element;
for(var i=0, len=els.length; i<len; i++) (function(el) {
_this.extend(el, function() {
args = slice.call(arguments);
args.unshift(el);
return p_elem.apply(_this, args);
}, force, local);
})(els[i]);
delete _this;
return this;
},
noConflict: function(new_name) {
new_name = new_name || "__newT";
try{delete window[_last_name];}catch(ex){window[_last_name] = undefined;}
window[temp] = _old_newt;
window[new_name] = _temp;
_last_name = new_name;
return this;
}
}
if (typeof module !== "undefined" && module.exports != null) {
module.exports = new T();
} else {
var _old_newt = window[temp], _temp, _last_name = temp;
window[temp] = _temp = new T();
}
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -0,0 +1,26 @@
tinymce.PluginManager.add('giphy', function(editor, url) {
// Add a button that opens a window
editor.addButton('giphy', {
title: 'Giphy GIF Search',
icon: true,
image: tinyMCE.baseURL + '/plugins/giphy/html/img/giphy_icon_16.png',
onclick : function(ev) {
var modalw = 480;
var modalh = 548;
editor.windowManager.open({
title : "Giphy Search",
file: url + '/html/giphy.html',
width : modalw,
height : modalh,
inline : true,
resizable: true,
scrollbars: true
}, {
plugin_url : url, // Plugin absolute URL
api_key : 'dc6zaTOxFJmzC', // the API key
api_host : 'http://api.giphy.com' // the API host
});
}
});
});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("hr",function(e){e.addCommand("InsertHorizontalRule",function(){e.execCommand("mceInsertContent",!1,"<hr />")}),e.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),e.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("importcss",function(e){function t(e){var t=tinymce.Env.cacheSuffix;return"string"==typeof e&&(e=e.replace("?"+t,"").replace("&"+t,"")),e}function n(t){var n=e.settings,r=n.skin!==!1&&(n.skin||"lightgray");if(r){var i=n.skin_url;return i=i?e.documentBaseURI.toAbsolute(i):tinymce.baseURL+"/skins/"+r,t===i+"/content"+(e.inline?".inline":"")+".min.css"}return!1}function r(e){return"string"==typeof e?function(t){return t.indexOf(e)!==-1}:e instanceof RegExp?function(t){return e.test(t)}:e}function i(r,i){function o(e,r){var s,l=e.href;if(l=t(l),l&&i(l,r)&&!n(l)){p(e.imports,function(e){o(e,!0)});try{s=e.cssRules||e.rules}catch(e){}p(s,function(e){e.styleSheet?o(e.styleSheet,!0):e.selectorText&&p(e.selectorText.split(","),function(e){a.push(tinymce.trim(e))})})}}var a=[],s={};p(e.contentCSS,function(e){s[e]=!0}),i||(i=function(e,t){return t||s[e]});try{p(r.styleSheets,function(e){o(e)})}finally{}return a}function o(t){var n,r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(r){var i=r[1],o=r[2].substr(1).split(".").join(" "),a=tinymce.makeMap("a,img");return r[1]?(n={title:t},e.schema.getTextBlockElements()[i]?n.block=i:e.schema.getBlockElements()[i]||a[i.toLowerCase()]?n.selector=i:n.inline=i):r[2]&&(n={inline:"span",title:t.substr(1),classes:o}),e.settings.importcss_merge_classes!==!1?n.classes=o:n.attributes={"class":o},n}}function a(e,t){return tinymce.util.Tools.grep(e,function(e){return!e.filter||e.filter(t)})}function s(e){return tinymce.util.Tools.map(e,function(e){return tinymce.util.Tools.extend({},e,{original:e,selectors:{},filter:r(e.filter),item:{text:e.title,menu:[]}})})}function l(e,t){return null===t||e.settings.importcss_exclusive!==!1}function c(t,n,r){return!(l(e,n)?t in r:t in n.selectors)}function u(t,n,r){l(e,n)?r[t]=!0:n.selectors[t]=!0}function d(t,n,r){var i,a=e.settings;return i=r&&r.selector_converter?r.selector_converter:a.importcss_selector_converter?a.importcss_selector_converter:o,i.call(t,n,r)}var f=this,p=tinymce.each;e.on("renderFormatsMenu",function(t){var n=e.settings,o={},l=r(n.importcss_selector_filter),m=t.control,h=s(n.importcss_groups),g=function(t,n){if(c(t,n,o)){u(t,n,o);var r=d(f,t,n);if(r){var i=r.name||tinymce.DOM.uniqueId();return e.formatter.register(i,r),tinymce.extend({},m.settings.itemDefaults,{text:r.title,format:i})}}return null};e.settings.importcss_append||m.items().remove(),p(i(t.doc||e.getDoc(),r(n.importcss_file_filter)),function(e){if(e.indexOf(".mce-")===-1&&(!l||l(e))){var t=a(h,e);if(t.length>0)tinymce.util.Tools.each(t,function(t){var n=g(e,t);n&&t.item.menu.push(n)});else{var n=g(e,null);n&&m.add(n)}}}),p(h,function(e){e.item.menu.length>0&&m.add(e.item)}),t.control.renderNew()}),f.convertSelectorToFormat=o});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("insertdatetime",function(e){function t(t,n){function r(e,t){if(e=""+e,e.length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}return n=n||new Date,t=t.replace("%D","%m/%d/%Y"),t=t.replace("%r","%I:%M:%S %p"),t=t.replace("%Y",""+n.getFullYear()),t=t.replace("%y",""+n.getYear()),t=t.replace("%m",r(n.getMonth()+1,2)),t=t.replace("%d",r(n.getDate(),2)),t=t.replace("%H",""+r(n.getHours(),2)),t=t.replace("%M",""+r(n.getMinutes(),2)),t=t.replace("%S",""+r(n.getSeconds(),2)),t=t.replace("%I",""+((n.getHours()+11)%12+1)),t=t.replace("%p",""+(n.getHours()<12?"AM":"PM")),t=t.replace("%B",""+e.translate(l[n.getMonth()])),t=t.replace("%b",""+e.translate(s[n.getMonth()])),t=t.replace("%A",""+e.translate(a[n.getDay()])),t=t.replace("%a",""+e.translate(o[n.getDay()])),t=t.replace("%%","%")}function n(n){var r=t(n);if(e.settings.insertdatetime_element){var i;i=t(/%[HMSIp]/.test(n)?"%Y-%m-%dT%H:%M":"%Y-%m-%d"),r='<time datetime="'+i+'">'+r+"</time>";var o=e.dom.getParent(e.selection.getStart(),"time");if(o)return void e.dom.setOuterHTML(o,r)}e.insertContent(r)}var r,i,o="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),s="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),l="January February March April May June July August September October November December".split(" "),c=[];e.addCommand("mceInsertDate",function(){n(e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),e.addCommand("mceInsertTime",function(){n(e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S")))}),e.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){n(r||i)},menu:c}),tinymce.each(e.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(e){i||(i=e),c.push({text:t(e),onclick:function(){r=e,n(e)}})}),e.addMenuItem("insertdatetime",{icon:"date",text:"Date/time",menu:c,context:"insert"})});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("layer",function(e){function t(e){do if(e.className&&-1!=e.className.indexOf("mceItemLayer"))return e;while(e=e.parentNode)}function n(t){var n=e.dom;tinymce.each(n.select("div,p",t),function(e){/^(absolute|relative|fixed)$/i.test(e.style.position)&&(e.hasVisual?n.addClass(e,"mceItemVisualAid"):n.removeClass(e,"mceItemVisualAid"),n.addClass(e,"mceItemLayer"))})}function r(n){var r,i,o=[],a=t(e.selection.getNode()),s=-1,l=-1;for(i=[],tinymce.walk(e.getBody(),function(e){1==e.nodeType&&/^(absolute|relative|static)$/i.test(e.style.position)&&i.push(e)},"childNodes"),r=0;r<i.length;r++)o[r]=i[r].style.zIndex?parseInt(i[r].style.zIndex,10):0,0>s&&i[r]==a&&(s=r);if(0>n){for(r=0;r<o.length;r++)if(o[r]<o[s]){l=r;break}l>-1?(i[s].style.zIndex=o[l],i[l].style.zIndex=o[s]):o[s]>0&&(i[s].style.zIndex=o[s]-1)}else{for(r=0;r<o.length;r++)if(o[r]>o[s]){l=r;break}l>-1?(i[s].style.zIndex=o[l],i[l].style.zIndex=o[s]):i[s].style.zIndex=o[s]+1}e.execCommand("mceRepaint")}function i(){var t=e.dom,n=t.getPos(t.getParent(e.selection.getNode(),"*")),r=e.getBody();e.dom.add(r,"div",{style:{position:"absolute",left:n.x,top:n.y>20?n.y:20,width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},e.selection.getContent()||e.getLang("layer.content")),tinymce.Env.ie&&t.setHTML(r,r.innerHTML)}function o(){var n=t(e.selection.getNode());n||(n=e.dom.getParent(e.selection.getNode(),"DIV,P,IMG")),n&&("absolute"==n.style.position.toLowerCase()?(e.dom.setStyles(n,{position:"",left:"",top:"",width:"",height:""}),e.dom.removeClass(n,"mceItemVisualAid"),e.dom.removeClass(n,"mceItemLayer")):(n.style.left||(n.style.left="20px"),n.style.top||(n.style.top="20px"),n.style.width||(n.style.width=n.width?n.width+"px":"100px"),n.style.height||(n.style.height=n.height?n.height+"px":"100px"),n.style.position="absolute",e.dom.setAttrib(n,"data-mce-style",""),e.addVisual(e.getBody())),e.execCommand("mceRepaint"),e.nodeChanged())}e.addCommand("mceInsertLayer",i),e.addCommand("mceMoveForward",function(){r(1)}),e.addCommand("mceMoveBackward",function(){r(-1)}),e.addCommand("mceMakeAbsolute",function(){o()}),e.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"}),e.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"}),e.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"}),e.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"}),e.on("init",function(){tinymce.Env.ie&&e.getDoc().execCommand("2D-Position",!1,!0)}),e.on("mouseup",function(n){var r=t(n.target);r&&e.dom.setAttrib(r,"data-mce-style","")}),e.on("mousedown",function(n){var r,i=n.target,o=e.getDoc();tinymce.Env.gecko&&(t(i)?"on"!==o.designMode&&(o.designMode="on",i=o.body,r=i.parentNode,r.removeChild(i),r.appendChild(i)):"on"==o.designMode&&(o.designMode="off"))}),e.on("NodeChange",n)});

View File

@@ -0,0 +1 @@
!function(e){e.PluginManager.add("legacyoutput",function(t,n,r){t.settings.inline_styles=!1,t.on("init",function(){var n="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",r=e.explode(t.settings.font_size_style_values),i=t.schema;t.formatter.register({alignleft:{selector:n,attributes:{align:"left"}},aligncenter:{selector:n,attributes:{align:"center"}},alignright:{selector:n,attributes:{align:"right"}},alignjustify:{selector:n,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(t){return e.inArray(r,t.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),e.each("b,i,u,strike".split(","),function(e){i.addValidElements(e+"[*]")}),i.getElementRule("font")||i.addValidElements("font[face|size|color|style]"),e.each(n.split(","),function(e){var t=i.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})}),t.addButton("fontsizeselect",function(){var e=[],n="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",r=t.settings.fontsize_formats||n;return t.$.each(r.split(" "),function(t,n){var r=n,i=n,o=n.split("=");o.length>1&&(r=o[0],i=o[1]),e.push({text:r,value:i})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:e,fixedWidth:!0,onPostRender:function(){var e=this;t.on("NodeChange",function(){var n;n=t.dom.getParent(t.selection.getNode(),"font"),n?e.value(n.size):e.value("")})},onclick:function(e){e.control.settings.value&&t.execCommand("FontSize",!1,e.control.settings.value)}}}),t.addButton("fontselect",function(){function e(e){e=e.replace(/;$/,"").split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=e(t.settings.font_formats||n);return r.each(o,function(e,t){i.push({text:{raw:t[0]},value:t[1],textStyle:t[1].indexOf("dings")==-1?"font-family:"+t[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:function(){var e=this;t.on("NodeChange",function(){var n;n=t.dom.getParent(t.selection.getNode(),"font"),n?e.value(n.face):e.value("")})},onselect:function(e){e.control.settings.value&&t.execCommand("FontName",!1,e.control.settings.value)}}})})}(tinymce);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
// Exports the "lists" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/lists')
// ES2015:
// import 'tinymce/plugins/lists'
require('./plugin.js');

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("nonbreaking",function(e){var t=e.getParam("nonbreaking_force_tab");if(e.addCommand("mceNonBreaking",function(){e.insertContent(e.plugins.visualchars&&e.plugins.visualchars.state?'<span class="mce-nbsp">&nbsp;</span>':"&nbsp;"),e.dom.setAttrib(e.dom.select("span.mce-nbsp"),"data-mce-bogus","1")}),e.addButton("nonbreaking",{title:"Nonbreaking space",cmd:"mceNonBreaking"}),e.addMenuItem("nonbreaking",{text:"Nonbreaking space",cmd:"mceNonBreaking",context:"insert"}),t){var n=+t>1?+t:3;e.on("keydown",function(t){if(9==t.keyCode){if(t.shiftKey)return;t.preventDefault();for(var r=0;r<n;r++)e.execCommand("mceNonBreaking")}})}});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("noneditable",function(e){function t(e){return function(t){return(" "+t.attr("class")+" ").indexOf(e)!==-1}}function n(t){function n(t){var n=arguments,r=n[n.length-2],i=r>0?a.charAt(r-1):"";if('"'===i)return t;if(">"===i){var o=a.lastIndexOf("<",r);if(o!==-1){var l=a.substring(o,r);if(l.indexOf('contenteditable="false"')!==-1)return t}}return'<span class="'+s+'" data-mce-content="'+e.dom.encode(n[0])+'">'+e.dom.encode("string"==typeof n[1]?n[1]:n[0])+"</span>"}var r=o.length,a=t.content,s=tinymce.trim(i);if("raw"!=t.format){for(;r--;)a=a.replace(o[r],n);t.content=a}}var r,i,o,a="contenteditable";r=" "+tinymce.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",i=" "+tinymce.trim(e.getParam("noneditable_noneditable_class","mceNonEditable"))+" ";var s=t(r),l=t(i);o=e.getParam("noneditable_regexp"),o&&!o.length&&(o=[o]),e.on("PreInit",function(){o&&e.on("BeforeSetContent",n),e.parser.addAttributeFilter("class",function(e){for(var t,n=e.length;n--;)t=e[n],s(t)?t.attr(a,"true"):l(t)&&t.attr(a,"false")}),e.serializer.addAttributeFilter(a,function(e){for(var t,n=e.length;n--;)t=e[n],(s(t)||l(t))&&(o&&t.attr("data-mce-content")?(t.name="#text",t.type=3,t.raw=!0,t.value=t.attr("data-mce-content")):t.attr(a,null))})})});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("pagebreak",function(e){var t="mce-pagebreak",n=e.getParam("pagebreak_separator","<!-- pagebreak -->"),r=new RegExp(n.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),i='<img src="'+tinymce.Env.transparentSrc+'" class="'+t+'" data-mce-resize="false" data-mce-placeholder />';e.addCommand("mcePageBreak",function(){e.settings.pagebreak_split_block?e.insertContent("<p>"+i+"</p>"):e.insertContent(i)}),e.addButton("pagebreak",{title:"Page break",cmd:"mcePageBreak"}),e.addMenuItem("pagebreak",{text:"Page break",icon:"pagebreak",cmd:"mcePageBreak",context:"insert"}),e.on("ResolveName",function(n){"IMG"==n.target.nodeName&&e.dom.hasClass(n.target,t)&&(n.name="pagebreak")}),e.on("click",function(n){n=n.target,"IMG"===n.nodeName&&e.dom.hasClass(n,t)&&e.selection.select(n)}),e.on("BeforeSetContent",function(e){e.content=e.content.replace(r,i)}),e.on("PreInit",function(){e.serializer.addNodeFilter("img",function(t){for(var r,i,o=t.length;o--;)if(r=t[o],i=r.attr("class"),i&&i.indexOf("mce-pagebreak")!==-1){var a=r.parent;if(e.schema.getBlockElements()[a.name]&&e.settings.pagebreak_split_block){a.type=3,a.value=n,a.raw=!0,r.remove();continue}r.type=3,r.value=n,r.raw=!0}})})});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("preview",function(e){var t=e.settings,n=!tinymce.Env.ie;e.addCommand("mcePreview",function(){e.windowManager.open({title:"Preview",width:parseInt(e.getParam("plugin_preview_width","650"),10),height:parseInt(e.getParam("plugin_preview_height","500"),10),html:'<iframe src="javascript:\'\'" frameborder="0"'+(n?' sandbox="allow-scripts"':"")+"></iframe>",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var r,i="";i+='<base href="'+e.documentBaseURI.getURI()+'">',tinymce.each(e.contentCSS,function(t){i+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'">'});var o=t.body_id||"tinymce";o.indexOf("=")!=-1&&(o=e.getParam("body_id","","hash"),o=o[e.id]||o);var a=t.body_class||"";a.indexOf("=")!=-1&&(a=e.getParam("body_class","","hash"),a=a[e.id]||"");var s='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A") {e.preventDefault();}}}, false);</script> ',l=e.settings.directionality?' dir="'+e.settings.directionality+'"':"";if(r="<!DOCTYPE html><html><head>"+i+'</head><body id="'+o+'" class="mce-content-body '+a+'"'+l+">"+e.getContent()+s+"</body></html>",n)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(r);else{var c=this.getEl("body").firstChild.contentWindow.document;c.open(),c.write(r),c.close()}}})}),e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("print",function(e){e.addCommand("mcePrint",function(){e.getWin().print()}),e.addButton("print",{title:"Print",cmd:"mcePrint"}),e.addShortcut("Meta+P","","mcePrint"),e.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Meta+P",context:"file"})});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("save",function(e){function t(){var t;if(t=tinymce.DOM.getParent(e.id,"form"),!e.getParam("save_enablewhendirty",!0)||e.isDirty())return tinymce.triggerSave(),e.getParam("save_onsavecallback")?(e.execCallback("save_onsavecallback",e),void e.nodeChanged()):void(t?(e.setDirty(!1),t.onsubmit&&!t.onsubmit()||("function"==typeof t.submit?t.submit():n(e.translate("Error: Form submit field collision."))),e.nodeChanged()):n(e.translate("Error: No form element found.")))}function n(t){e.notificationManager.open({text:t,type:"error"})}function r(){var t=tinymce.trim(e.startContent);return e.getParam("save_oncancelcallback")?void e.execCallback("save_oncancelcallback",e):(e.setContent(t),e.undoManager.clear(),void e.nodeChanged())}function i(){var t=this;e.on("nodeChange dirty",function(){t.disabled(e.getParam("save_enablewhendirty",!0)&&!e.isDirty())})}e.addCommand("mceSave",t),e.addCommand("mceCancel",r),e.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:i}),e.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:i}),e.addShortcut("Meta+S","","mceSave")});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("tabfocus",function(e){function t(e){9!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}function n(t){function n(n){function o(e){return"BODY"===e.nodeName||"hidden"!=e.type&&"none"!=e.style.display&&"hidden"!=e.style.visibility&&o(e.parentNode)}function l(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&tinymce.get(t.id)&&e.tabIndex!=-1&&o(e)}if(s=r.select(":input:enabled,*[tabindex]:not(iframe)"),i(s,function(t,n){if(t.id==e.id)return a=n,!1}),n>0){for(c=a+1;c<s.length;c++)if(l(s[c]))return s[c]}else for(c=a-1;c>=0;c--)if(l(s[c]))return s[c];return null}var a,s,l,c;if(!(9!==t.keyCode||t.ctrlKey||t.altKey||t.metaKey||t.isDefaultPrevented())&&(l=o(e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))),1==l.length&&(l[1]=l[0],l[0]=":prev"),s=t.shiftKey?":prev"==l[0]?n(-1):r.get(l[0]):":next"==l[1]?n(1):r.get(l[1]))){var u=tinymce.get(s.id||s.name);s.id&&u?u.focus():tinymce.util.Delay.setTimeout(function(){tinymce.Env.webkit||window.focus(),s.focus()},10),t.preventDefault()}}var r=tinymce.DOM,i=tinymce.each,o=tinymce.explode;e.on("init",function(){e.inline&&tinymce.DOM.setAttrib(e.getBody(),"tabIndex",null),e.on("keyup",t),tinymce.Env.gecko?e.on("keypress keydown",n):e.on("keydown",n)})});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("template",function(e){function t(t){return function(){var n=e.settings.templates;return"function"==typeof n?void n(t):void("string"==typeof n?tinymce.util.XHR.send({url:n,success:function(e){t(tinymce.util.JSON.parse(e))}}):t(n))}}function n(t){function n(t){function n(t){if(t.indexOf("<html>")==-1){var n="";tinymce.each(e.contentCSS,function(t){n+='<link type="text/css" rel="stylesheet" href="'+e.documentBaseURI.toAbsolute(t)+'">'});var i=e.settings.body_class||"";i.indexOf("=")!=-1&&(i=e.getParam("body_class","","hash"),i=i[e.id]||""),t="<!DOCTYPE html><html><head>"+n+'</head><body class="'+i+'">'+t+"</body></html>"}t=o(t,"template_preview_replace_values");var a=r.find("iframe")[0].getEl().contentWindow.document;a.open(),a.write(t),a.close()}var a=t.control.value();a.url?tinymce.util.XHR.send({url:a.url,success:function(e){i=e,n(i)}}):(i=a.content,n(i)),r.find("#description")[0].text(t.control.value().description)}var r,i,s=[];if(!t||0===t.length){var l=e.translate("No templates defined.");return void e.notificationManager.open({text:l,type:"info"})}tinymce.each(t,function(e){s.push({selected:!s.length,text:e.title,value:{url:e.url,content:e.content,description:e.description}})}),r=e.windowManager.open({title:"Insert template",layout:"flex",direction:"column",align:"stretch",padding:15,spacing:10,items:[{type:"form",flex:0,padding:0,items:[{type:"container",label:"Templates",items:{type:"listbox",label:"Templates",name:"template",values:s,onselect:n}}]},{type:"label",name:"description",label:"Description",text:"\xa0"},{type:"iframe",flex:1,border:1}],onsubmit:function(){a(!1,i)},minWidth:Math.min(tinymce.DOM.getViewPort().w,e.getParam("template_popup_width",600)),minHeight:Math.min(tinymce.DOM.getViewPort().h,e.getParam("template_popup_height",500))}),r.find("listbox")[0].fire("select")}function r(t,n){function r(e,t){if(e=""+e,e.length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}var i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),a="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),s="January February March April May June July August September October November December".split(" ");return n=n||new Date,t=t.replace("%D","%m/%d/%Y"),t=t.replace("%r","%I:%M:%S %p"),t=t.replace("%Y",""+n.getFullYear()),t=t.replace("%y",""+n.getYear()),t=t.replace("%m",r(n.getMonth()+1,2)),t=t.replace("%d",r(n.getDate(),2)),t=t.replace("%H",""+r(n.getHours(),2)),t=t.replace("%M",""+r(n.getMinutes(),2)),t=t.replace("%S",""+r(n.getSeconds(),2)),t=t.replace("%I",""+((n.getHours()+11)%12+1)),t=t.replace("%p",""+(n.getHours()<12?"AM":"PM")),t=t.replace("%B",""+e.translate(s[n.getMonth()])),t=t.replace("%b",""+e.translate(a[n.getMonth()])),t=t.replace("%A",""+e.translate(o[n.getDay()])),t=t.replace("%a",""+e.translate(i[n.getDay()])),t=t.replace("%%","%")}function i(t){var n=e.dom,r=e.getParam("template_replace_values");s(n.select("*",t),function(e){s(r,function(t,i){n.hasClass(e,i)&&"function"==typeof r[i]&&r[i](e)})})}function o(t,n){return s(e.getParam(n),function(e,n){"function"==typeof e&&(e=e(n)),t=t.replace(new RegExp("\\{\\$"+n+"\\}","g"),e)}),t}function a(t,n){function a(e,t){return new RegExp("\\b"+t+"\\b","g").test(e.className)}var l,c,u=e.dom,d=e.selection.getContent();n=o(n,"template_replace_values"),l=u.create("div",null,n),c=u.select(".mceTmpl",l),c&&c.length>0&&(l=u.create("div",null),l.appendChild(c[0].cloneNode(!0))),s(u.select("*",l),function(t){a(t,e.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(t.innerHTML=r(e.getParam("template_cdate_format",e.getLang("template.cdate_format")))),a(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=r(e.getParam("template_mdate_format",e.getLang("template.mdate_format")))),a(t,e.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(t.innerHTML=d)}),i(l),e.execCommand("mceInsertContent",!1,l.innerHTML),e.addVisual()}var s=tinymce.each;e.addCommand("mceInsertTemplate",a),e.addButton("template",{title:"Insert template",onclick:t(n)}),e.addMenuItem("template",{text:"Template",onclick:t(n),context:"insert"}),e.on("PreProcess",function(t){var n=e.dom;s(n.select("div",t.node),function(t){n.hasClass(t,"mceTmpl")&&(s(n.select("*",t),function(t){n.hasClass(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=r(e.getParam("template_mdate_format",e.getLang("template.mdate_format"))))}),i(t))})})});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("textcolor",function(e){function t(t){var n;return e.dom.getParents(e.selection.getStart(),function(e){var r;(r=e.style["forecolor"==t?"color":"background-color"])&&(n=r)}),n}function n(t){var n,r,i=[];for(r=["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],r=e.settings.textcolor_map||r,r=e.settings[t+"_map"]||r,n=0;n<r.length;n+=2)i.push({text:r[n+1],color:"#"+r[n]});return i}function r(){function t(e,t){var n="transparent"==e;return'<td class="mce-grid-cell'+(n?" mce-colorbtn-trans":"")+'"><div id="'+m+"-"+h++ +'" data-mce-color="'+(e?e:"")+'" role="option" tabIndex="-1" style="'+(e?"background-color: "+e:"")+'" title="'+tinymce.translate(t)+'">'+(n?"&#215;":"")+"</div></td>"}var r,i,o,a,s,u,d,f,p=this,m=p._id,h=0;for(f=p.settings.origin,r=n(f),r.push({text:tinymce.translate("No color"),color:"transparent"}),o='<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',a=r.length-1,u=0;u<c[f];u++){for(o+="<tr>",s=0;s<l[f];s++)d=u*l[f]+s,d>a?o+="<td></td>":(i=r[d],o+=t(i.color,i.text));o+="</tr>"}if(e.settings.color_picker_callback){for(o+='<tr><td colspan="'+l[f]+'" class="mce-custom-color-btn"><div id="'+m+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+m+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+tinymce.translate("Custom...")+"</button></div></td></tr>",o+="<tr>",s=0;s<l[f];s++)o+=t("","Custom color");o+="</tr>"}return o+="</tbody></table>"}function i(t,n){e.undoManager.transact(function(){e.focus(),e.formatter.apply(t,{value:n}),e.nodeChanged()})}function o(t){e.undoManager.transact(function(){e.focus(),e.formatter.remove(t,{value:null},null,!0),e.nodeChanged()})}function a(n){function r(e){d.hidePanel(),d.color(e),i(d.settings.format,e)}function a(){d.hidePanel(),d.resetColor(),o(d.settings.format)}function s(e,t){e.style.background=t,e.setAttribute("data-mce-color",t)}var c,u,d=this.parent();u=d.settings.origin,tinymce.DOM.getParent(n.target,".mce-custom-color-btn")&&(d.hidePanel(),e.settings.color_picker_callback.call(e,function(e){var t,n,i,o=d.panel.getEl().getElementsByTagName("table")[0];for(t=tinymce.map(o.rows[o.rows.length-1].childNodes,function(e){return e.firstChild}),i=0;i<t.length&&(n=t[i],n.getAttribute("data-mce-color"));i++);if(i==l[u])for(i=0;i<l[u]-1;i++)s(t[i],t[i+1].getAttribute("data-mce-color"));s(n,e),r(e)},t(d.settings.format))),c=n.target.getAttribute("data-mce-color"),c?(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),n.target.setAttribute("aria-selected",!0),this.lastId=n.target.id,"transparent"==c?a():r(c)):null!==c&&d.hidePanel()}function s(){var e=this;e._color?i(e.settings.format,e._color):o(e.settings.format)}var l,c;c={forecolor:e.settings.forecolor_rows||e.settings.textcolor_rows||5,backcolor:e.settings.backcolor_rows||e.settings.textcolor_rows||5},l={forecolor:e.settings.forecolor_cols||e.settings.textcolor_cols||8,backcolor:e.settings.backcolor_cols||e.settings.textcolor_cols||8},e.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{origin:"forecolor",role:"application",ariaRemember:!0,html:r,onclick:a},onclick:s}),e.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{origin:"backcolor",role:"application",ariaRemember:!0,html:r,onclick:a},onclick:s})});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("textpattern",function(e){function t(){return c&&(l.sort(function(e,t){return e.start.length>t.start.length?-1:e.start.length<t.start.length?1:0}),c=!1),l}function n(e){for(var n=t(),r=0;r<n.length;r++)if(0===e.indexOf(n[r].start)&&(!n[r].end||e.lastIndexOf(n[r].end)==e.length-n[r].end.length))return n[r]}function r(e,n,r){var i,o,a;for(i=t(),a=0;a<i.length;a++)if(o=i[a],o.end&&e.substr(n-o.end.length-r,o.end.length)==o.end)return o}function i(t){function i(){l=l.splitText(u),l.splitText(c-u-m),l.deleteData(0,p.start.length),l.deleteData(l.data.length-p.end.length,p.end.length)}var o,a,s,l,c,u,d,f,p,m,h;if(o=e.selection,a=e.dom,o.isCollapsed()&&(s=o.getRng(!0),l=s.startContainer,c=s.startOffset,d=l.data,m=t?1:0,3==l.nodeType&&(p=r(d,c,m),p&&(u=Math.max(0,c-m),u=d.lastIndexOf(p.start,u-p.end.length-1),u!==-1&&(f=a.createRng(),f.setStart(l,u),f.setEnd(l,c-m),p=n(f.toString()),p&&p.end&&!(l.data.length<=p.start.length+p.end.length))))))return h=e.formatter.get(p.format),h&&h[0].inline?(i(),e.formatter.apply(p.format,{},l),l):void 0}function o(){var t,r,i,o,a,s,l,c,u,d,f;if(t=e.selection,r=e.dom,t.isCollapsed()&&(l=r.getParent(t.getStart(),"p"))){for(u=new tinymce.dom.TreeWalker(l,l);a=u.next();)if(3==a.nodeType){o=a;break}if(o){if(c=n(o.data),!c)return;if(d=t.getRng(!0),i=d.startContainer,f=d.startOffset,o==i&&(f=Math.max(0,f-c.start.length)),tinymce.trim(o.data).length==c.start.length)return;c.format&&(s=e.formatter.get(c.format),s&&s[0].block&&(o.deleteData(0,c.start.length),e.formatter.apply(c.format,{},o),d.setStart(i,f),d.collapse(!0),t.setRng(d))),c.cmd&&e.undoManager.transact(function(){o.deleteData(0,c.start.length),e.execCommand(c.cmd)})}}}function a(){var t,n;n=i(),n&&(t=e.dom.createRng(),t.setStart(n,n.data.length),t.setEnd(n,n.data.length),e.selection.setRng(t)),o()}function s(){var t,n,r,o,a;t=i(!0),t&&(a=e.dom,n=t.data.slice(-1),/[\u00a0 ]/.test(n)&&(t.deleteData(t.data.length-1,1),r=a.doc.createTextNode(n),t.nextSibling?a.insertAfter(r,t.nextSibling):t.parentNode.appendChild(r),o=a.createRng(),o.setStart(r,1),o.setEnd(r,1),e.selection.setRng(o)))}var l,c=!0;l=e.settings.textpattern_patterns||[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],e.on("keydown",function(e){13!=e.keyCode||tinymce.util.VK.modifierPressed(e)||a()},!0),e.on("keyup",function(e){32!=e.keyCode||tinymce.util.VK.modifierPressed(e)||s()}),this.getPatterns=t,this.setPatterns=function(e){l=e,c=!0}});

View File

@@ -0,0 +1 @@
tinymce.PluginManager.add("toc",function(e){function t(t){return e.schema.isValidChild("div",t)}function n(t){return t&&e.dom.is(t,"."+d.className)&&e.getBody().contains(t)}function r(){var t=this;t.disabled(e.readonly||!o()),e.on("LoadContent SetContent change",function(){t.disabled(e.readonly||!o())})}function i(e){var t,n=[];for(t=1;t<=e;t++)n.push("h"+t);return n.join(",")}function o(){return!(!d||!a(d).length)}function a(t){var n=i(t.depth),r=f(n);return r.length&&/^h[1-9]$/i.test(t.headerTag)&&(r=r.filter(function(n,r){return!e.dom.hasClass(r.parentNode,t.className)})),tinymce.map(r,function(e){return e.id||(e.id=h()),{id:e.id,level:parseInt(e.nodeName.replace(/^H/i,""),10),title:f.text(e)}})}function s(e){var t,n=9;for(t=0;t<e.length;t++)if(e[t].level<n&&(n=e[t].level),1==n)return n;return n}function l(t,n){var r="<"+t+' contenteditable="true">',i="</"+t+">";return r+e.dom.encode(n)+i}function c(e){var t=u(e);return'<div class="'+e.className+'" contenteditable="false">'+t+"</div>"}function u(e){var t,n,r,i,o="",c=a(e),u=s(c)-1;if(!c.length)return"";for(o+=l(e.headerTag,tinymce.translate("Table of Contents")),t=0;t<c.length;t++){if(r=c[t],i=c[t+1]&&c[t+1].level,u===r.level)o+="<li>";else for(n=u;n<r.level;n++)o+="<ul><li>";if(o+='<a href="#'+r.id+'">'+r.title+"</a>",i!==r.level&&i)for(n=r.level;n>i;n--)o+="</li></ul><li>";else o+="</li>",i||(o+="</ul>");u=r.level}return o}var d,f=e.$,p={depth:3,headerTag:"h2",className:"mce-toc"},m=function(e){var t=0;return function(){var n=(new Date).getTime().toString(32);return e+n+(t++).toString(32)}},h=m("mcetoc_");e.on("PreInit",function(){var n=e.settings,r=parseInt(n.toc_depth,10)||0;d={depth:r>=1&&r<=9?r:p.depth,headerTag:t(n.toc_header)?n.toc_header:p.headerTag,className:n.toc_class?e.dom.encode(n.toc_class):p.className}}),e.on("PreProcess",function(e){var t=f("."+d.className,e.node);t.length&&(t.removeAttr("contentEditable"),t.find("[contenteditable]").removeAttr("contentEditable"))}),e.on("SetContent",function(){var e=f("."+d.className);e.length&&(e.attr("contentEditable",!1),e.children(":first-child").attr("contentEditable",!0))});var g=function(t){return!t.length||e.dom.getParents(t[0],".mce-offscreen-selection").length>0};e.addCommand("mceInsertToc",function(){var t=f("."+d.className);g(t)?e.insertContent(c(d)):e.execCommand("mceUpdateToc")}),e.addCommand("mceUpdateToc",function(){var t=f("."+d.className);t.length&&e.undoManager.transact(function(){t.html(u(d))})}),e.addButton("toc",{tooltip:"Table of Contents",cmd:"mceInsertToc",icon:"toc",onPostRender:r}),e.addButton("tocupdate",{tooltip:"Update",cmd:"mceUpdateToc",icon:"reload"}),e.addContextToolbar(n,"tocupdate"),e.addMenuItem("toc",{text:"Table of Contents",context:"insert",cmd:"mceInsertToc",onPostRender:r})});

View File

@@ -0,0 +1,135 @@
.mce-visualblocks p {
padding-top: 10px;
border: 1px dashed #BBB;
margin-left: 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);
}
.mce-visualblocks h1 {
padding-top: 10px;
border: 1px dashed #BBB;
margin-left: 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);
}
.mce-visualblocks h2 {
padding-top: 10px;
border: 1px dashed #BBB;
margin-left: 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);
}
.mce-visualblocks h3 {
padding-top: 10px;
border: 1px dashed #BBB;
margin-left: 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);
}
.mce-visualblocks h4 {
padding-top: 10px;
border: 1px dashed #BBB;
margin-left: 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);
}
.mce-visualblocks h5 {
padding-top: 10px;
border: 1px dashed #BBB;
margin-left: 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);
}
.mce-visualblocks h6 {
padding-top: 10px;
border: 1px dashed #BBB;
margin-left: 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);
}
.mce-visualblocks div:not([data-mce-bogus]) {
padding-top: 10px;
border: 1px dashed #BBB;
margin-left: 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);
}
.mce-visualblocks section {
padding-top: 10px;
border: 1px dashed #BBB;
margin: 0 0 1em 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);
}
.mce-visualblocks article {
padding-top: 10px;
border: 1px dashed #BBB;
margin: 0 0 1em 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);
}
.mce-visualblocks blockquote {
padding-top: 10px;
border: 1px dashed #BBB;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);
}
.mce-visualblocks address {
padding-top: 10px;
border: 1px dashed #BBB;
margin: 0 0 1em 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);
}
.mce-visualblocks pre {
padding-top: 10px;
border: 1px dashed #BBB;
margin-left: 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);
}
.mce-visualblocks figure {
padding-top: 10px;
border: 1px dashed #BBB;
margin: 0 0 1em 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);
}
.mce-visualblocks hgroup {
padding-top: 10px;
border: 1px dashed #BBB;
margin: 0 0 1em 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);
}
.mce-visualblocks aside {
padding-top: 10px;
border: 1px dashed #BBB;
margin: 0 0 1em 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);
}
.mce-visualblocks figcaption {
border: 1px dashed #BBB;
}
.mce-visualblocks ul {
padding-top: 10px;
border: 1px dashed #BBB;
margin: 0 0 1em 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)
}
.mce-visualblocks ol {
padding-top: 10px;
border: 1px dashed #BBB;
margin: 0 0 1em 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);
}
.mce-visualblocks dl {
padding-top: 10px;
border: 1px dashed #BBB;
margin: 0 0 1em 3px;
background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);
}

Some files were not shown because too many files have changed in this diff Show More