From 3f70cbb20bebae5befd71ecccd451dca93da1a3f Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 10 Sep 2012 15:45:39 +0000 Subject: [PATCH] Fixed adding genres, start of edit/delete --- app/config/routes.php | 1 + app/modules/meta/controllers/category.php | 2 +- app/modules/meta/controllers/genre.php | 3 + app/modules/meta/controllers/section.php | 5 +- app/modules/meta/models/model.php | 4 +- app/modules/meta/views/category_detail.php | 11 +- app/modules/meta/views/genre_detail.php | 10 +- app/modules/meta/views/genres.php | 12 +- app/modules/meta/views/section_detail.php | 4 +- assets/config/config.php | 5 +- assets/config/css_groups.php | 3 +- assets/config/js_groups.php | 1 + assets/css.php | 4 + assets/css/theme.css | 49 ++- assets/css/tinyeditor.css | 57 ++++ assets/images/header-bg.gif | Bin 0 -> 55 bytes assets/images/icons.png | Bin 0 -> 16261 bytes assets/images/resize.gif | Bin 0 -> 78 bytes assets/js/cache/js | 51 ++- assets/js/meta.js | 57 +++- assets/js/tinyeditor.js | 373 +++++++++++++++++++++ assets/js/tinyeditor/index.html | 35 ++ assets/js/tinyeditor/packed.js | 1 + 23 files changed, 650 insertions(+), 38 deletions(-) create mode 100755 assets/css/tinyeditor.css create mode 100755 assets/images/header-bg.gif create mode 100755 assets/images/icons.png create mode 100755 assets/images/resize.gif create mode 100755 assets/js/tinyeditor.js create mode 100755 assets/js/tinyeditor/index.html create mode 100755 assets/js/tinyeditor/packed.js diff --git a/app/config/routes.php b/app/config/routes.php index f8a56c7..adcd071 100644 --- a/app/config/routes.php +++ b/app/config/routes.php @@ -34,6 +34,7 @@ return [ 'default_controller' => 'welcome', 'default_module' => 'meta', 'genre' => 'meta/genre/index', + 'genre/add' => 'meta/genre/add', 'genre/add_category' => 'meta/genre/add_category', 'category' => 'meta/category/index', 'category/add_section' => 'meta/category/add_section', diff --git a/app/modules/meta/controllers/category.php b/app/modules/meta/controllers/category.php index 32266ea..4a05575 100644 --- a/app/modules/meta/controllers/category.php +++ b/app/modules/meta/controllers/category.php @@ -74,7 +74,7 @@ class category extends meta\controller { $this->page->set_message('error', 'Section already exists for this category'); } - $this->detail($id); + $this->index($id); } } diff --git a/app/modules/meta/controllers/genre.php b/app/modules/meta/controllers/genre.php index 19f3133..144460e 100644 --- a/app/modules/meta/controllers/genre.php +++ b/app/modules/meta/controllers/genre.php @@ -97,6 +97,9 @@ class genre extends meta\controller { $this->load_view('genre_detail', $data); } + /** + * Adds a category to the current genre + */ public function add_category() { // Strip away tags for the sake of security diff --git a/app/modules/meta/controllers/section.php b/app/modules/meta/controllers/section.php index 04d572b..f13a59d 100644 --- a/app/modules/meta/controllers/section.php +++ b/app/modules/meta/controllers/section.php @@ -62,7 +62,10 @@ class section extends meta\controller { $keys = filter_var_array($_POST['name'], FILTER_SANITIZE_STRING); - $vals = filter_var_array($_POST['val'], FILTER_SANITIZE_STRING); + + // Raw to allow use of HTML formatting + // Prepared statements keep the database safe here. + $vals = $_POST['val']; $data = array_combine($keys, $vals); diff --git a/app/modules/meta/models/model.php b/app/modules/meta/models/model.php index c5a31ff..f3a0e9a 100644 --- a/app/modules/meta/models/model.php +++ b/app/modules/meta/models/model.php @@ -106,8 +106,8 @@ class model extends \miniMVC\Model { // Fetch the data as a workaround // for databases that do not support // grabbing result counts (SQLite / Firebird) - $array = $query->fetchAll(); - if (empty($array)) + $array = $query->fetchAll(\PDO::FETCH_ASSOC); + if (count($array) < 1) { $this->db->set('genre', $genre) ->insert('genre'); diff --git a/app/modules/meta/views/category_detail.php b/app/modules/meta/views/category_detail.php index 8e7e0be..2415262 100644 --- a/app/modules/meta/views/category_detail.php +++ b/app/modules/meta/views/category_detail.php @@ -13,7 +13,7 @@
-
+ @@ -23,6 +23,10 @@
  • ">

    + + + + @@ -30,7 +34,10 @@ ") !== FALSE) ? 'multiline' : 'pair' ?>
    -
    +
    + + +
    diff --git a/app/modules/meta/views/genre_detail.php b/app/modules/meta/views/genre_detail.php index caab403..8049090 100644 --- a/app/modules/meta/views/genre_detail.php +++ b/app/modules/meta/views/genre_detail.php @@ -13,14 +13,20 @@
    -
    + diff --git a/app/modules/meta/views/genres.php b/app/modules/meta/views/genres.php index 85cce01..603f4f7 100644 --- a/app/modules/meta/views/genres.php +++ b/app/modules/meta/views/genres.php @@ -9,13 +9,21 @@
     
    -
    + \ No newline at end of file diff --git a/app/modules/meta/views/section_detail.php b/app/modules/meta/views/section_detail.php index cc00275..17c13aa 100644 --- a/app/modules/meta/views/section_detail.php +++ b/app/modules/meta/views/section_detail.php @@ -16,10 +16,10 @@
    -
    +
    -
    + diff --git a/assets/config/config.php b/assets/config/config.php index 2f44507..c1748dd 100755 --- a/assets/config/config.php +++ b/assets/config/config.php @@ -13,6 +13,7 @@ // -------------------------------------------------------------------------- + /** * Asset management configuration file * @@ -53,7 +54,7 @@ $css_root = $document_root. 'css/'; | Path fragment to rewrite in css files | */ -$path_from = ''; +$path_from = './images/'; /* |-------------------------------------------------------------------------- @@ -63,7 +64,7 @@ $path_from = ''; | The path fragment replacement for the css files | */ -$path_to = ''; +$path_to = '//github.timshomepage.net/meta/assets/images/'; /* |-------------------------------------------------------------------------- diff --git a/assets/config/css_groups.php b/assets/config/css_groups.php index cb100fe..2113b50 100644 --- a/assets/config/css_groups.php +++ b/assets/config/css_groups.php @@ -23,7 +23,8 @@ return array( 'css' => array( 'normalize.css', 'message.css', - 'theme.css' + 'theme.css', + 'tinyeditor.css' ) ); // End of css_groups.php \ No newline at end of file diff --git a/assets/config/js_groups.php b/assets/config/js_groups.php index 811ef79..663235a 100755 --- a/assets/config/js_groups.php +++ b/assets/config/js_groups.php @@ -28,6 +28,7 @@ return array( 'js' => array( 'kis-lite-dom-min.js', + 'tinyeditor.js', 'meta.js' ), ); \ No newline at end of file diff --git a/assets/css.php b/assets/css.php index c6059ab..44bc32d 100755 --- a/assets/css.php +++ b/assets/css.php @@ -113,6 +113,10 @@ if ($last_modified === $requested_time) exit(); } +// Correct paths that have changed due to concatenation +// based on rules in the config file +$css = str_replace($path_from, $path_to, $css); + if (!isset($_GET['debug'])) { $css = compress($css); diff --git a/assets/css/theme.css b/assets/css/theme.css index d939611..5722b0d 100644 --- a/assets/css/theme.css +++ b/assets/css/theme.css @@ -11,6 +11,10 @@ html, body { button { color:#312; + padding:5px; + border:1px solid #555; + border-radius:5px; + box-shadow:1px 1px #a98; } a { @@ -30,7 +34,6 @@ legend:hover { } h1,h2 { - display:-moz-inline-box; display:inline-block; vertical-align:middle; width:25%; @@ -43,8 +46,8 @@ fieldset dl { /* form styles */ form dt, form dd { - display:-moz-inline-box; /* For older versions of Mozilla/Firefox */ display:inline-block; + vertical-align:top; padding:0.25em 0; } @@ -60,7 +63,40 @@ form dd { padding-left:.25em; } -/* Outline styles */ +/* ! Edit buttons */ +.modify { + position:absolute; + display:none; + margin-left:1em; +} + +li:hover .modify, dt:hover .modify { + display:inline-block; +} + +button.save { + background:#797; + color:#eee; +} + +button.save:hover { + background:#595; +} + +button.edit { + +} + +button.delete { + background:#977; + color:#eee; +} + +button.delete:hover { + background:#955; +} + +/* ! Outline styles */ .list { padding:0; margin:0; @@ -74,7 +110,11 @@ form dd { list-style:none; } -/* Data listing styles */ +li h4 { + display:inline; +} + +/* ! Data listing styles */ dl.multiline, dl.pair { border-bottom:1px dotted #312; } @@ -92,7 +132,6 @@ dl.multiline dd { } dl.pair dt, dl.pair dd { - display:-moz-inline-block; display:inline-block; padding:0.25em 0; } diff --git a/assets/css/tinyeditor.css b/assets/css/tinyeditor.css new file mode 100755 index 0000000..af30fb8 --- /dev/null +++ b/assets/css/tinyeditor.css @@ -0,0 +1,57 @@ +.te { + border: 1px solid #bbb; + padding: 0 1px 1px; + font: 12px Verdana,Arial; +} + .te iframe { border: none } +.teheader { + height: 31px; + border-bottom: 1px solid #bbb; + background: url(./images/header-bg.gif) repeat-x; + padding-top: 1px; + overflow: hidden; +} +.testyle { margin-right: 12px } +.tedivider { + float: left; + width: 1px; + height: 30px; + background: #ccc; +} +.tecontrol { + float: left; + width: 34px; + height: 30px; + cursor: pointer; + background-image: url(./images/icons.png); +} +.tecontrol:hover { + background-color: #fff; + background-position: 30px 0; +} +.tefooter { + height: 32px; + border-top: 1px solid #bbb; + background: #f5f5f5; +} +.toggle { + float: left; + background: url(./images/icons.png) -34px 2px no-repeat; + padding: 9px 13px 0 31px; + height: 23px; + border-right: 1px solid #ccc; + cursor: pointer; + color: #666; +} +.toggle:hover { background-color: #fff } +.resize { + float: right; + height: 32px; + width: 32px; + background: url(./images/resize.gif) 15px 15px no-repeat; + cursor: s-resize; +} +#editor { + cursor: text; + margin: 10px; +} \ No newline at end of file diff --git a/assets/images/header-bg.gif b/assets/images/header-bg.gif new file mode 100755 index 0000000000000000000000000000000000000000..a23a14d2e21601902c61203aac53c9f0ea4b72b5 GIT binary patch literal 55 zcmZ?wbhEHbWMoian8?8J_U+sM|Np;!{rc0VPl`WT7(hS=M1bTOm^jY#tyFmX--(gI F8UR|}6Sx2X literal 0 HcmV?d00001 diff --git a/assets/images/icons.png b/assets/images/icons.png new file mode 100755 index 0000000000000000000000000000000000000000..e88b564ffac7d595db9754de0c47a2fccdf82f6e GIT binary patch literal 16261 zcmZ{LbyQn@x;0LqK}spwV8x3|arfe`#i6(dcc*A^Eydm4wMe13YmlNvi|cpZxifd( zZ_OS4IV3A9E9d+k*?T|xiBM9I!ayfNhl7K|kdYQw0j}b3aEM?K3h>{-DLfN!A#{<@ za#6K6cX2avGJ_K_wKp~+ld(1WWTs+fWa{BKY{m}QH%YM zVBDz@>g652PeZ?njk|xFn{VBBdih-c{QW!ras1?~*Uqs(lQcmnImaW73>^Y`FhY(n zE%yIh;+~zz&d$za{6dKLIt4YAAUMwH$L};NU0k400V@-eX^+kR2nF|}4ExTK;?mMq zWi_>n-@PF(-Z8>&opJKStQ~*Oi*cPAyVpNAhRWSN=}TCK983C&^wnvuT~^_)iY7A~ z9B*!KyUdJ?l)2g3+7h~Tbar-vt2VqM@fe+65=%CzYcuIHeaavM=37c#(gE9&- za#C}1GxtiHo1)vVA4&Qd?`=P9`k6mH+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p2`J6I7hQUOk+Qgo1dbsA1s$1LIQxI{*Lx literal 0 HcmV?d00001 diff --git a/assets/images/resize.gif b/assets/images/resize.gif new file mode 100755 index 0000000000000000000000000000000000000000..385ec279591d8e727bc9e118ca6f457329ed8cb3 GIT binary patch literal 78 zcmZ?wbhEHb"],["Header 1","

    "],["Header 2","

    "],["Header 3","

    "],["Header 4","

    "],["Header 5","

    "],["Header 6","
    "]];k=m.length;h=0; +g.className="testyle";g.onchange=new Function(this.n+'.ddaction(this,"formatblock")');for(h;h";f=a.bodyid?' id="'+a.bodyid+'"':"";a.cssfile&&(b+='');a.css&&(b+='"); +b+=""+(a.content||this.t.value);this.e.write(b+"");this.e.close();this.e.designMode="on";this.d=1;if(this.xhtml)try{this.e.execCommand("styleWithCSS",0,0)}catch(p){try{this.e.execCommand("useCSS",0,1)}catch(q){}}}var e=[],d=-30;e.cut=[1,"Cut","a","cut",1];e.copy=[2,"Copy","a","copy",1];e.paste=[3,"Paste","a","paste",1];e.bold=[4,"Bold","a","bold"];e.italic=[5,"Italic","a","italic"];e.underline=[6,"Underline","a","underline"];e.strikethrough=[7,"Strikethrough","a","strikethrough"]; +e.subscript=[8,"Subscript","a","subscript"];e.superscript=[9,"Superscript","a","superscript"];e.orderedlist=[10,"Insert Ordered List","a","insertorderedlist"];e.unorderedlist=[11,"Insert Unordered List","a","insertunorderedlist"];e.outdent=[12,"Outdent","a","outdent"];e.indent=[13,"Indent","a","indent"];e.leftalign=[14,"Left Align","a","justifyleft"];e.centeralign=[15,"Center Align","a","justifycenter"];e.rightalign=[16,"Right Align","a","justifyright"];e.blockjustify=[17,"Block Justify","a","justifyfull"]; +e.undo=[18,"Undo","a","undo"];e.redo=[19,"Redo","a","redo"];e.image=[20,"Insert Image","i","insertimage","Enter Image URL:","http://"];e.hr=[21,"Insert Horizontal Rule","a","inserthorizontalrule"];e.link=[22,"Insert Hyperlink","i","createlink","Enter URL:","http://"];e.unlink=[23,"Remove Hyperlink","a","unlink"];e.unformat=[24,"Remove Formatting","a","removeformat"];e.print=[25,"Print","a","print"];f.prototype.print=function(){this.i.contentWindow.print()};f.prototype.hover=function(c,a,b){c.style.backgroundPosition= +(b?"34px ":"0px ")+a+"px"};f.prototype.ddaction=function(c,a){this.action(a,c.options[c.selectedIndex].value)};f.prototype.action=function(c,a,b){b&&!this.ie?alert("Your browser does not support this function."):this.e.execCommand(c,0,a||null)};f.prototype.insert=function(c,a,b){c=prompt(c,a);null!=c&&""!=c&&this.e.execCommand(b,0,c)};f.prototype.setfont=function(){execCommand("formatblock",0,hType)};f.prototype.resize=function(c){this.mv&&this.freeze();this.i.bcs=TINY.cursor.top(c);this.mv=new Function("event", +this.n+".move(event)");this.sr=new Function(this.n+".freeze()");this.ie?(document.attachEvent("onmousemove",this.mv),document.attachEvent("onmouseup",this.sr)):(document.addEventListener("mousemove",this.mv,1),document.addEventListener("mouseup",this.sr,1))};f.prototype.move=function(c){c=TINY.cursor.top(c);this.i.height=parseInt(this.i.height)+c-this.i.bcs;this.i.bcs=c};f.prototype.freeze=function(){this.ie?(document.detachEvent("onmousemove",this.mv),document.detachEvent("onmouseup",this.sr)):(document.removeEventListener("mousemove", +this.mv,1),document.removeEventListener("mouseup",this.sr,1))};f.prototype.toggle=function(c,a){if(this.d){if(b=this.e.body.innerHTML,this.xhtml&&(b=b.replace(/(.*)<\/span>/gi,"$1"),b=b.replace(/ class="apple-style-span"/gi,""),b=b.replace(//gi,""),b=b.replace(/
    /gi,"
    "),b=b.replace(/
    $/gi,""),b=b.replace(/^
    /gi,""),b=b.replace(/(]+[^\/])>/gi,"$1 />"),b=b.replace(/]*>(.*?)<\/b[^>]*>/gi,"$1"),b=b.replace(/]*>(.*?)<\/i[^>]*>/gi, +"$1"),b=b.replace(/]*>(.*?)<\/u[^>]*>/gi,'$1'),b=b.replace(/<(b|strong|em|i|u) style="font-weight: normal;?">(.*)<\/(b|strong|em|i|u)>/gi,"$2"),b=b.replace(/<(b|strong|em|i|u) style="(.*)">(.*)<\/(b|strong|em|i|u)>/gi,'<$4>$3'),b=b.replace(/(.*)<\/span>/gi,"$1"),b=b.replace(/(.*)<\/span>/gi,"$1"),b=b.replace(/(.*)<\/span>/gi, +"$1"),b=b.replace(/(.*)<\/span>|]*>(.*?)<\/b[^>]*>/gi,"$1")),a&&(a.innerHTML=this.obj.toggletext||"wysiwyg"),this.t.value=b,!c)this.t.style.height=this.i.height+"px",this.i.style.display="none",this.t.style.display="block",this.d=0}else{var b=this.t.value;a&&(a.innerHTML=this.obj.toggletext||"source");this.xhtml&&!this.ie&&(b=b.replace(/(.*)<\/strong>/gi,'$1'),b=b.replace(/(.*)<\/em>/gi, +'$1'));this.e.body.innerHTML=b;this.t.style.display="none";this.i.style.display="block";this.d=1}};f.prototype.post=function(){this.d&&this.toggle(1)};return{edit:f}}();TINY.cursor=function(){return{top:function(f){return T$$$()?window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop:f.clientY+window.scrollY}}}(); +(function(){$_("fieldset dl").dom.hide();$_("fieldset legend").event.add("click",function(){var f=$_("fieldset dl").dom;"none"==f.css("display").trim()?f.show():f.hide()});$_("button.delete").event.add("click",function(){var f=this.parentNode.id,f=f.split("_");confirm("Are you sure you want to delete this "+f[0]+"? Deleting this item will delete all items under it. There is no undo.")});new TINY.editor.edit("editor",{id:"input",width:450,height:175,cssclass:"te",controlclass:"tecontrol",rowclass:"teheader", +dividerclass:"tedivider",controls:"bold italic underline | subscript superscript | orderedlist unorderedlist | leftalign centeralign rightalign | unformat | undo redo n image hr link unlink | cut copy paste print".split(" "),footer:!0,xhtml:!0,cssfile:"//github.timshomepage.net/meta/assets/css.php/g/css",bodyid:"editor",footerclass:"tefooter",toggle:{text:"source",activetext:"wysiwyg",cssclass:"toggle"},resize:{cssclass:"resize"}})})(); diff --git a/assets/js/meta.js b/assets/js/meta.js index f52e52a..fd2441e 100644 --- a/assets/js/meta.js +++ b/assets/js/meta.js @@ -2,7 +2,7 @@ "use strict"; - // Show/hide forms based on use + // ! Show/hide forms based on use $_("fieldset dl").dom.hide(); $_("fieldset legend").event.add('click', function(e){ var form = $_("fieldset dl").dom; @@ -12,4 +12,59 @@ : form.hide(); }); + var meta = {}; + + /** + * Deletes a genre/category/section/data item + * based on the current page context + */ + meta.delete_item = function(e) { + // Get the type/id of the item + var item_id = this.parentNode.id; + item_id = item_id.split('_'); + + var id = item_id[1]; + var type = item_id[0]; + + // Confirm deletion + var confirm_string = "Are you sure you want to delete this "+type+"? Deleting this item will delete all items under it. There is no undo."; + + var do_delete = confirm(confirm_string); + + // Call the appropriate deletion method + + + // Show status message + }; + + // ------------------------------------------------- + // ! Event binding + // ------------------------------------------------- + + // Delete Button functionality + $_("button.delete").event.add('click', meta.delete_item); + + // WYSIWYG + new TINY.editor.edit('editor',{ + id:'input', + width:450, + height:175, + cssclass:'te', + controlclass:'tecontrol', + rowclass:'teheader', + dividerclass:'tedivider', + controls:['bold','italic','underline','|','subscript','superscript','|', + 'orderedlist','unorderedlist','|','leftalign', + 'centeralign','rightalign','|','unformat','|','undo','redo','n', + 'image','hr','link','unlink','|','cut','copy','paste','print'], + footer:true, + //fonts:['Verdana','Arial','Georgia','Trebuchet MS'], + xhtml:true, + cssfile:'//github.timshomepage.net/meta/assets/css.php/g/css', + bodyid:'editor', + footerclass:'tefooter', + toggle:{text:'source',activetext:'wysiwyg',cssclass:'toggle'}, + resize:{cssclass:'resize'} + }); + }()); \ No newline at end of file diff --git a/assets/js/tinyeditor.js b/assets/js/tinyeditor.js new file mode 100755 index 0000000..d8d7f9a --- /dev/null +++ b/assets/js/tinyeditor.js @@ -0,0 +1,373 @@ +var TINY = {}; + +function T$(i) +{ + return document.getElementById(i) +} + +function T$$$() +{ + return document.all ? 1 : 0 +} + +TINY.editor = function () +{ + var c = [], + offset = -30; + c['cut'] = [1, 'Cut', 'a', 'cut', 1]; + c['copy'] = [2, 'Copy', 'a', 'copy', 1]; + c['paste'] = [3, 'Paste', 'a', 'paste', 1]; + c['bold'] = [4, 'Bold', 'a', 'bold']; + c['italic'] = [5, 'Italic', 'a', 'italic']; + c['underline'] = [6, 'Underline', 'a', 'underline']; + c['strikethrough'] = [7, 'Strikethrough', 'a', 'strikethrough']; + c['subscript'] = [8, 'Subscript', 'a', 'subscript']; + c['superscript'] = [9, 'Superscript', 'a', 'superscript']; + c['orderedlist'] = [10, 'Insert Ordered List', 'a', 'insertorderedlist']; + c['unorderedlist'] = [11, 'Insert Unordered List', 'a', 'insertunorderedlist']; + c['outdent'] = [12, 'Outdent', 'a', 'outdent']; + c['indent'] = [13, 'Indent', 'a', 'indent']; + c['leftalign'] = [14, 'Left Align', 'a', 'justifyleft']; + c['centeralign'] = [15, 'Center Align', 'a', 'justifycenter']; + c['rightalign'] = [16, 'Right Align', 'a', 'justifyright']; + c['blockjustify'] = [17, 'Block Justify', 'a', 'justifyfull']; + c['undo'] = [18, 'Undo', 'a', 'undo']; + c['redo'] = [19, 'Redo', 'a', 'redo']; + c['image'] = [20, 'Insert Image', 'i', 'insertimage', 'Enter Image URL:', 'http://']; + c['hr'] = [21, 'Insert Horizontal Rule', 'a', 'inserthorizontalrule']; + c['link'] = [22, 'Insert Hyperlink', 'i', 'createlink', 'Enter URL:', 'http://']; + c['unlink'] = [23, 'Remove Hyperlink', 'a', 'unlink']; + c['unformat'] = [24, 'Remove Formatting', 'a', 'removeformat']; + c['print'] = [25, 'Print', 'a', 'print']; + + function edit(n, obj) + { + this.n = n; + window[n] = this; + this.t = T$(obj.id); + this.obj = obj; + this.xhtml = obj.xhtml; + var p = document.createElement('div'), + w = document.createElement('div'), + h = document.createElement('div'), + l = obj.controls.length, + i = 0; + this.i = document.createElement('iframe'); + this.i.frameBorder = 0; + this.i.width = obj.width || '500'; + this.i.height = obj.height || '250'; + this.ie = T$$$(); + h.className = obj.rowclass || 'teheader'; + p.className = obj.cssclass || 'te'; + p.style.width = this.i.width + 'px'; + p.appendChild(h); + for (i; i < l; i++) + { + var id = obj.controls[i]; + if (id == 'n') + { + h = document.createElement('div'); + h.className = obj.rowclass || 'teheader'; + p.appendChild(h) + } + else if (id == '|') + { + var d = document.createElement('div'); + d.className = obj.dividerclass || 'tedivider'; + h.appendChild(d) + } + else if (id == 'font') + { + var sel = document.createElement('select'), + fonts = obj.fonts || ['Verdana', 'Arial', 'Georgia'], + fl = fonts.length, + x = 0; + sel.className = 'tefont'; + sel.onchange = new Function(this.n + '.ddaction(this,"fontname")'); + sel.options[0] = new Option('Font', ''); + for (x; x < fl; x++) + { + var font = fonts[x]; + sel.options[x + 1] = new Option(font, font) + } + h.appendChild(sel) + } + else if (id == 'size') + { + var sel = document.createElement('select'), + sizes = obj.sizes || [1, 2, 3, 4, 5, 6, 7], + sl = sizes.length, + x = 0; + sel.className = 'tesize'; + sel.onchange = new Function(this.n + '.ddaction(this,"fontsize")'); + for (x; x < sl; x++) + { + var size = sizes[x]; + sel.options[x] = new Option(size, size) + } + h.appendChild(sel) + } + else if (id == 'style') + { + var sel = document.createElement('select'), + styles = obj.styles || [ + ['Style', ''], + ['Paragraph', '

    '], + ['Header 1', '

    '], + ['Header 2', '

    '], + ['Header 3', '

    '], + ['Header 4', '

    '], + ['Header 5', '

    '], + ['Header 6', '
    '] + ], + sl = styles.length, + x = 0; + sel.className = 'testyle'; + sel.onchange = new Function(this.n + '.ddaction(this,"formatblock")'); + for (x; x < sl; x++) + { + var style = styles[x]; + sel.options[x] = new Option(style[0], style[1]) + } + h.appendChild(sel) + } + else if (c[id]) + { + var div = document.createElement('div'), + x = c[id], + func = x[2], + ex, pos = x[0] * offset; + div.className = obj.controlclass; + div.style.backgroundPosition = '0px ' + pos + 'px'; + div.title = x[1]; + ex = func == 'a' ? '.action("' + x[3] + '",0,' + (x[4] || 0) + ')' : '.insert("' + x[4] + '","' + x[5] + '","' + x[3] + '")'; + div.onclick = new Function(this.n + (id == 'print' ? '.print()' : ex)); + div.onmouseover = new Function(this.n + '.hover(this,' + pos + ',1)'); + div.onmouseout = new Function(this.n + '.hover(this,' + pos + ',0)'); + h.appendChild(div); + if (this.ie) + { + div.unselectable = 'on' + } + } + } + this.t.parentNode.insertBefore(p, this.t); + this.t.style.width = this.i.width + 'px'; + w.appendChild(this.t); + w.appendChild(this.i); + p.appendChild(w); + this.t.style.display = 'none'; + if (obj.footer) + { + var f = document.createElement('div'); + f.className = obj.footerclass || 'tefooter'; + if (obj.toggle) + { + var to = obj.toggle, + ts = document.createElement('div'); + ts.className = to.cssclass || 'toggle'; + ts.innerHTML = obj.toggletext || 'source'; + ts.onclick = new Function(this.n + '.toggle(0,this);return false'); + f.appendChild(ts) + } + if (obj.resize) + { + var ro = obj.resize, + rs = document.createElement('div'); + rs.className = ro.cssclass || 'resize'; + rs.onmousedown = new Function('event', this.n + '.resize(event);return false'); + rs.onselectstart = function () + { + return false + }; + f.appendChild(rs) + } + p.appendChild(f) + } + this.e = this.i.contentWindow.document; + this.e.open(); + var m = '', + bodyid = obj.bodyid ? " id=\"" + obj.bodyid + "\"" : ""; + if (obj.cssfile) + { + m += '' + } + if (obj.css) + { + m += '' + } + m += '' + (obj.content || this.t.value); + m += ''; + this.e.write(m); + this.e.close(); + this.e.designMode = 'on'; + this.d = 1; + if (this.xhtml) + { + try + { + this.e.execCommand("styleWithCSS", 0, 0) + } + catch (e) + { + try + { + this.e.execCommand("useCSS", 0, 1) + } + catch (e) + {} + } + } + }; + edit.prototype.print = function () + { + this.i.contentWindow.print() + }, + edit.prototype.hover = function (div, pos, dir) + { + div.style.backgroundPosition = (dir ? '34px ' : '0px ') + (pos) + 'px' + }, + edit.prototype.ddaction = function (dd, a) + { + var i = dd.selectedIndex, + v = dd.options[i].value; + this.action(a, v) + }, + edit.prototype.action = function (cmd, val, ie) + { + if (ie && !this.ie) + { + alert('Your browser does not support this function.') + } + else + { + this.e.execCommand(cmd, 0, val || null) + } + }, + edit.prototype.insert = function (pro, msg, cmd) + { + var val = prompt(pro, msg); + if (val != null && val != '') + { + this.e.execCommand(cmd, 0, val) + } + }, + edit.prototype.setfont = function () + { + execCommand('formatblock', 0, hType) + }, + edit.prototype.resize = function (e) + { + if (this.mv) + { + this.freeze() + } + this.i.bcs = TINY.cursor.top(e); + this.mv = new Function('event', this.n + '.move(event)'); + this.sr = new Function(this.n + '.freeze()'); + if (this.ie) + { + document.attachEvent('onmousemove', this.mv); + document.attachEvent('onmouseup', this.sr) + } + else + { + document.addEventListener('mousemove', this.mv, 1); + document.addEventListener('mouseup', this.sr, 1) + } + }, + edit.prototype.move = function (e) + { + var pos = TINY.cursor.top(e); + this.i.height = parseInt(this.i.height) + pos - this.i.bcs; + this.i.bcs = pos + }, + edit.prototype.freeze = function () + { + if (this.ie) + { + document.detachEvent('onmousemove', this.mv); + document.detachEvent('onmouseup', this.sr) + } + else + { + document.removeEventListener('mousemove', this.mv, 1); + document.removeEventListener('mouseup', this.sr, 1) + } + }, + edit.prototype.toggle = function (post, div) + { + if (!this.d) + { + var v = this.t.value; + if (div) + { + div.innerHTML = this.obj.toggletext || 'source' + } + if (this.xhtml && !this.ie) + { + v = v.replace(/(.*)<\/strong>/gi, '$1'); + v = v.replace(/(.*)<\/em>/gi, '$1') + } + this.e.body.innerHTML = v; + this.t.style.display = 'none'; + this.i.style.display = 'block'; + this.d = 1 + } + else + { + var v = this.e.body.innerHTML; + if (this.xhtml) + { + v = v.replace(/(.*)<\/span>/gi, '$1'); + v = v.replace(/ class="apple-style-span"/gi, ''); + v = v.replace(//gi, ''); + v = v.replace(/
    /gi, '
    '); + v = v.replace(/
    $/gi, ''); + v = v.replace(/^
    /gi, ''); + v = v.replace(/(]+[^\/])>/gi, '$1 />'); + v = v.replace(/]*>(.*?)<\/b[^>]*>/gi, '$1'); + v = v.replace(/]*>(.*?)<\/i[^>]*>/gi, '$1'); + v = v.replace(/]*>(.*?)<\/u[^>]*>/gi, '$1'); + v = v.replace(/<(b|strong|em|i|u) style="font-weight: normal;?">(.*)<\/(b|strong|em|i|u)>/gi, '$2'); + v = v.replace(/<(b|strong|em|i|u) style="(.*)">(.*)<\/(b|strong|em|i|u)>/gi, '<$4>$3'); + v = v.replace(/(.*)<\/span>/gi, '$1'); + v = v.replace(/(.*)<\/span>/gi, '$1'); + v = v.replace(/(.*)<\/span>/gi, '$1'); + v = v.replace(/(.*)<\/span>|]*>(.*?)<\/b[^>]*>/gi, '$1') + } + if (div) + { + div.innerHTML = this.obj.toggletext || 'wysiwyg' + } + this.t.value = v; + if (!post) + { + this.t.style.height = this.i.height + 'px'; + this.i.style.display = 'none'; + this.t.style.display = 'block'; + this.d = 0 + } + } + }, + edit.prototype.post = function () + { + if (this.d) + { + this.toggle(1) + } + }; + return { + edit: edit + } +}(); + +TINY.cursor = function () +{ + return { + top: function (e) + { + return T$$$() ? window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop : e.clientY + window.scrollY + } + } +}(); \ No newline at end of file diff --git a/assets/js/tinyeditor/index.html b/assets/js/tinyeditor/index.html new file mode 100755 index 0000000..17977d6 --- /dev/null +++ b/assets/js/tinyeditor/index.html @@ -0,0 +1,35 @@ + + + + +TinyEditor - JavaScript WYSIWYG Editor + + + + + + + + \ No newline at end of file diff --git a/assets/js/tinyeditor/packed.js b/assets/js/tinyeditor/packed.js new file mode 100755 index 0000000..6dbafbe --- /dev/null +++ b/assets/js/tinyeditor/packed.js @@ -0,0 +1 @@ +TINY={};function T$(i){return document.getElementById(i)}function T$$$(){return document.all?1:0}TINY.editor=function(){var c=[],offset=-30;c['cut']=[1,'Cut','a','cut',1];c['copy']=[2,'Copy','a','copy',1];c['paste']=[3,'Paste','a','paste',1];c['bold']=[4,'Bold','a','bold'];c['italic']=[5,'Italic','a','italic'];c['underline']=[6,'Underline','a','underline'];c['strikethrough']=[7,'Strikethrough','a','strikethrough'];c['subscript']=[8,'Subscript','a','subscript'];c['superscript']=[9,'Superscript','a','superscript'];c['orderedlist']=[10,'Insert Ordered List','a','insertorderedlist'];c['unorderedlist']=[11,'Insert Unordered List','a','insertunorderedlist'];c['outdent']=[12,'Outdent','a','outdent'];c['indent']=[13,'Indent','a','indent'];c['leftalign']=[14,'Left Align','a','justifyleft'];c['centeralign']=[15,'Center Align','a','justifycenter'];c['rightalign']=[16,'Right Align','a','justifyright'];c['blockjustify']=[17,'Block Justify','a','justifyfull'];c['undo']=[18,'Undo','a','undo'];c['redo']=[19,'Redo','a','redo'];c['image']=[20,'Insert Image','i','insertimage','Enter Image URL:','http://'];c['hr']=[21,'Insert Horizontal Rule','a','inserthorizontalrule'];c['link']=[22,'Insert Hyperlink','i','createlink','Enter URL:','http://'];c['unlink']=[23,'Remove Hyperlink','a','unlink'];c['unformat']=[24,'Remove Formatting','a','removeformat'];c['print']=[25,'Print','a','print'];function edit(n,a){this.n=n;window[n]=this;this.t=T$(a.id);this.obj=a;this.xhtml=a.xhtml;var p=document.createElement('div'),w=document.createElement('div'),h=document.createElement('div'),l=a.controls.length,i=0;this.i=document.createElement('iframe');this.i.frameBorder=0;this.i.width=a.width||'500';this.i.height=a.height||'250';this.ie=T$$$();h.className='teheader';p.className=a.cssclass||'te';p.style.width=this.i.width+'px';p.appendChild(h);for(i;i'],['Header 1','

    '],['Header 2','

    '],['Header 3','

    '],['Header 4','

    '],['Header 5','

    '],['Header 6','
    ']],sl=styles.length,x=0;g.className='testyle';g.onchange=new Function(this.n+'.ddaction(this,"formatblock")');for(x;x'}if(a.css){m+=''}m+=''+(a.content||this.t.value);m+='';this.e.write(m);this.e.close();this.e.designMode='on';this.d=1;if(this.xhtml){try{this.e.execCommand("styleWithCSS",0,0)}catch(e){try{this.e.execCommand("useCSS",0,1)}catch(e){}}}};edit.prototype.print=function(){this.i.contentWindow.print()},edit.prototype.hover=function(a,b,c){a.style.backgroundPosition=(c?'34px ':'0px ')+(b)+'px'},edit.prototype.ddaction=function(b,a){var i=b.selectedIndex,v=b.options[i].value;this.action(a,v)},edit.prototype.action=function(a,b,c){if(c&&!this.ie){alert('Your browser does not support this function.')}else{this.e.execCommand(a,0,b||null)}},edit.prototype.insert=function(a,b,c){var d=prompt(a,b);if(d!=null&&d!=''){this.e.execCommand(c,0,d)}},edit.prototype.setfont=function(){execCommand('formatblock',0,hType)},edit.prototype.resize=function(e){if(this.mv){this.freeze()}this.i.bcs=TINY.cursor.top(e);this.mv=new Function('event',this.n+'.move(event)');this.sr=new Function(this.n+'.freeze()');if(this.ie){document.attachEvent('onmousemove',this.mv);document.attachEvent('onmouseup',this.sr)}else{document.addEventListener('mousemove',this.mv,1);document.addEventListener('mouseup',this.sr,1)}},edit.prototype.move=function(e){var a=TINY.cursor.top(e);this.i.height=parseInt(this.i.height)+a-this.i.bcs;this.i.bcs=a},edit.prototype.freeze=function(){if(this.ie){document.detachEvent('onmousemove',this.mv);document.detachEvent('onmouseup',this.sr)}else{document.removeEventListener('mousemove',this.mv,1);document.removeEventListener('mouseup',this.sr,1)}},edit.prototype.toggle=function(b,c){if(!this.d){var v=this.t.value;if(c){c.innerHTML=this.obj.toggletext||'source'}if(this.xhtml&&!this.ie){v=v.replace(/(.*)<\/strong>/gi,'$1');v=v.replace(/(.*)<\/em>/gi,'$1')}this.e.body.innerHTML=v;this.t.style.display='none';this.i.style.display='block';this.d=1}else{var v=this.e.body.innerHTML;if(this.xhtml){v=v.replace(/<[^>]*>/g,function(a){return a.toLowerCase()});v=v.replace(/(.*)<\/span>/g,'$1');v=v.replace(/ class="apple-style-span"/g,'');v=v.replace(//g,'');v=v.replace(/
    /g,'
    ');v=v.replace(/
    $/g,'');v=v.replace(/^
    /g,'');v=v.replace(/(]+[^\/])>/gi,'$1 />');v=v.replace(/]*>(.*?)<\/b[^>]*>/g,'$1');v=v.replace(/]*>(.*?)<\/i[^>]*>/g,'$1');v=v.replace(/]*>(.*?)<\/u[^>]*>/g,'$1');v=v.replace(/<(b|strong|em|i|u) style="font-weight: normal;?">(.*)<\/(b|strong|em|i|u)>/g,'$2');v=v.replace(/<(b|strong|em|i|u) style="(.*)">(.*)<\/(b|strong|em|i|u)>/g,'<$4>$3');v=v.replace(/(.*)<\/span>/g,'$1');v=v.replace(/(.*)<\/span>/g,'$1');v=v.replace(/(.*)<\/span>/g,'$1');v=v.replace(/(.*)<\/span>|]*>(.*?)<\/b[^>]*>/g,'$1')}if(c){c.innerHTML=this.obj.toggletext||'wysiwyg'}this.t.value=v;if(!b){this.t.style.height=this.i.height+'px';this.i.style.display='none';this.t.style.display='block';this.d=0}}},edit.prototype.post=function(){if(this.d){this.toggle(1)}};return{edit:edit}}();TINY.cursor=function(){return{top:function(e){return T$$$()?window.event.clientY+document.documentElement.scrollTop+document.body.scrollTop:e.clientY+window.scrollY}}}(); \ No newline at end of file