diff options
author | Friendika <info@friendika.com> | 2011-07-20 03:54:10 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-07-20 03:54:10 -0700 |
commit | 40092c83a5568a9896c05f7ccdd8da4649f5271a (patch) | |
tree | 4a3750df636bf641fd0de2f92287c305b2ae151d /view | |
parent | b27d68633be6219c3f65d830178e3dc96c1c91e9 (diff) | |
parent | 19c93adf846647a61e407e8172ea7153cb7f2c41 (diff) | |
download | volse-hubzilla-40092c83a5568a9896c05f7ccdd8da4649f5271a.tar.gz volse-hubzilla-40092c83a5568a9896c05f7ccdd8da4649f5271a.tar.bz2 volse-hubzilla-40092c83a5568a9896c05f7ccdd8da4649f5271a.zip |
Merge pull request #142 from fabrixxm/newacl
More on ACL and editor
Diffstat (limited to 'view')
-rw-r--r-- | view/acl_selector.tpl | 12 | ||||
-rw-r--r-- | view/head.tpl | 2 | ||||
-rw-r--r-- | view/jot-header.tpl | 149 | ||||
-rw-r--r-- | view/jot.tpl | 25 | ||||
-rw-r--r-- | view/photos_upload.tpl | 19 | ||||
-rw-r--r-- | view/theme/duepuntozero/style.css | 11 | ||||
-rw-r--r-- | view/theme/loozah/style.css | 12 |
7 files changed, 134 insertions, 96 deletions
diff --git a/view/acl_selector.tpl b/view/acl_selector.tpl index 3379f5764..3f8a9e7d2 100644 --- a/view/acl_selector.tpl +++ b/view/acl_selector.tpl @@ -15,10 +15,12 @@ </div> <script> -$(function(){ - acl = new ACL( - baseurl+"/acl", - [$allowcid,$allowgid,$denycid,$denygid] - ); +$(document).ready(function() { + if(typeof acl=="undefined"){ + acl = new ACL( + baseurl+"/acl", + [$allowcid,$allowgid,$denycid,$denygid] + ); + } }); </script> diff --git a/view/head.tpl b/view/head.tpl index f26e41b51..9d73269e1 100644 --- a/view/head.tpl +++ b/view/head.tpl @@ -2,6 +2,7 @@ <base href="$baseurl/" /> <meta name="generator" content="$generator" /> <link rel="stylesheet" type="text/css" href="$stylesheet" media="all" /> +<link rel="stylesheet" href="$baseurl/library/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" /> <link rel="shortcut icon" href="$baseurl/images/friendika-32.png" /> <link rel="search" href="$baseurl/opensearch" @@ -12,6 +13,7 @@ <script type="text/javascript" src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <script type="text/javascript" src="$baseurl/include/jquery.js" ></script> +<script type="text/javascript" src="$baseurl/library/fancybox/jquery.fancybox-1.3.4.pack.js"></script> <script type="text/javascript" src="$baseurl/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js" ></script> <script type="text/javascript" src="$baseurl/include/acl.js" ></script> <script type="text/javascript" src="$baseurl/include/main.js" ></script> diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 7d215bd46..061f6a71d 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -1,72 +1,94 @@ <script language="javascript" type="text/javascript"> -var editor; +var editor=false; var textlen = 0; -tinyMCE.init({ - theme : "advanced", - mode : "specific_textareas", - editor_selector: /(profile-jot-text|prvmail-text)/, - plugins : "bbcode,paste,autoresize", - theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code", - theme_advanced_buttons2 : "", - theme_advanced_buttons3 : "", - theme_advanced_toolbar_location : "top", - theme_advanced_toolbar_align : "center", - theme_advanced_blockformats : "blockquote,code", - paste_text_sticky : true, - entity_encoding : "raw", - add_unload_trigger : false, - remove_linebreaks : false, - force_p_newlines : false, - force_br_newlines : true, - forced_root_block : '', - convert_urls: false, - content_css: "$baseurl/view/custom_tinymce.css", - theme_advanced_path : false, - setup : function(ed) { - //Character count - ed.onKeyUp.add(function(ed, e) { - var txt = tinyMCE.activeEditor.getContent(); - textlen = txt.length; - if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) { - $('#profile-jot-desc').html(ispublic); - } - else { - $('#profile-jot-desc').html(' '); - } - - if(textlen <= 140) { - $('#character-counter').removeClass('red'); - $('#character-counter').removeClass('orange'); - $('#character-counter').addClass('grey'); - } - if((textlen > 140) && (textlen <= 420)) { - $('#character-counter').removeClass('grey'); - $('#character-counter').removeClass('red'); - $('#character-counter').addClass('orange'); - } - if(textlen > 420) { - $('#character-counter').removeClass('grey'); - $('#character-counter').removeClass('orange'); - $('#character-counter').addClass('red'); - } - $('#character-counter').text(textlen); - }); +function initEditor(){ + $("#profile-jot-text-loading").show(); + tinyMCE.init({ + theme : "advanced", + mode : "specific_textareas", + editor_selector: /(profile-jot-text|prvmail-text)/, + plugins : "bbcode,paste,autoresize", + theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code", + theme_advanced_buttons2 : "", + theme_advanced_buttons3 : "", + theme_advanced_toolbar_location : "top", + theme_advanced_toolbar_align : "center", + theme_advanced_blockformats : "blockquote,code", + paste_text_sticky : true, + entity_encoding : "raw", + add_unload_trigger : false, + remove_linebreaks : false, + force_p_newlines : false, + force_br_newlines : true, + forced_root_block : '', + convert_urls: false, + content_css: "$baseurl/view/custom_tinymce.css", + theme_advanced_path : false, + setup : function(ed) { + //Character count + ed.onKeyUp.add(function(ed, e) { + var txt = tinyMCE.activeEditor.getContent(); + textlen = txt.length; + if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) { + $('#profile-jot-desc').html(ispublic); + } + else { + $('#profile-jot-desc').html(' '); + } - ed.onInit.add(function(ed) { - ed.pasteAsPlainText = true; - }); + if(textlen <= 140) { + $('#character-counter').removeClass('red'); + $('#character-counter').removeClass('orange'); + $('#character-counter').addClass('grey'); + } + if((textlen > 140) && (textlen <= 420)) { + $('#character-counter').removeClass('grey'); + $('#character-counter').removeClass('red'); + $('#character-counter').addClass('orange'); + } + if(textlen > 420) { + $('#character-counter').removeClass('grey'); + $('#character-counter').removeClass('orange'); + $('#character-counter').addClass('red'); + } + $('#character-counter').text(textlen); + }); - } -}); + ed.onInit.add(function(ed) { + ed.pasteAsPlainText = true; + $("#profile-jot-text-loading").hide(); + $("#profile-jot-submit-wrapper").show(); + }); + + } + }); + editor = true; + + // setup acl popup + $("#profile-jot-acl-wrapper").hide(); + $("a#jot-perms-icon").fancybox({ + 'transitionIn' : 'none', + 'transitionOut' : 'none' + }); +} </script> <script type="text/javascript" src="include/ajaxupload.js" ></script> <script> var ispublic = '$ispublic'; $(document).ready(function() { + + /* enable tinymce on focus */ + $("#profile-jot-text").focus(function(){ + if (editor) return; + $(this).val(""); + initEditor(); + }); + + var uploader = new window.AjaxUpload( 'wall-image-upload', { action: 'wall_upload/$nickname', @@ -90,21 +112,6 @@ tinyMCE.init({ } ); - /*$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() { - var selstr; - $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() { - selstr = $(this).text(); - $('#jot-perms-icon').removeClass('unlock').addClass('lock'); - $('#jot-public').hide(); - $('.profile-jot-net input').attr('disabled', 'disabled'); - }); - if(selstr == null) { - $('#jot-perms-icon').removeClass('lock').addClass('unlock'); - $('#jot-public').show(); - $('.profile-jot-net input').attr('disabled', false); - } - - }).trigger('change');*/ }); diff --git a/view/jot.tpl b/view/jot.tpl index 15fc460e1..aa9892cbb 100644 --- a/view/jot.tpl +++ b/view/jot.tpl @@ -15,10 +15,12 @@ <input type="hidden" name="title" id="jot-title" value="" /> <input type="hidden" name="post_id" value="$post_id" /> - <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >$content</textarea> + <img id="profile-jot-text-loading" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" /> + <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{ if $content }}$content{{ else }}$share{{ endif }}</textarea> + {{ if $content }}<script>initEditor();</script>{{ endif }} -<div id="profile-jot-submit-wrapper" > +<div id="profile-jot-submit-wrapper" style="display:none"> <input type="submit" id="profile-jot-submit" name="submit" value="$share" /> <div id="profile-upload-wrapper" style="display: $visitor;" > <div id="wall-image-upload-div" ><a href="#" onclick="return false;" id="wall-image-upload" class="icon camera" title="$upload"></a></div> @@ -57,19 +59,20 @@ <img id="profile-rotator" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" /> </div> <div id="profile-jot-perms" class="profile-jot-perms" style="display: $pvisit;" > - <a id="jot-perms-icon" class="icon $lockstate" title="$permset" onClick="openClose('profile-jot-acl-wrapper'); openClose('profile-jot-email-wrapper'); openClose('profile-jot-networks');return false;"></a>$bang + <a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="icon $lockstate" title="$permset" ></a>$bang </div> <div id="profile-jot-perms-end"></div> - <div id="profile-jot-email-wrapper" style="display: none;" > - <div id="profile-jot-email-label">$emailcc</div><input type="text" name="emailcc" id="profile-jot-email" title="$emtitle" /> - <div id="profile-jot-email-end"></div> - </div> - <div id="profile-jot-networks" style="display: none;" > - $jotnets + <div style="display: none;"> + <div id="profile-jot-acl-wrapper" style="width:auto;height:auto;overflow:auto;"> + $acl + <hr style="clear:both"/> + <div id="profile-jot-email-label">$emailcc</div><input type="text" name="emailcc" id="profile-jot-email" title="$emtitle" /> + <div id="profile-jot-email-end"></div> + $jotnets + </div> </div> - <div id="profile-jot-networks-end"></div> - <div id="profile-jot-acl-wrapper" style="display: none;" >$acl</div> + </div> <div id="profile-jot-end"></div> diff --git a/view/photos_upload.tpl b/view/photos_upload.tpl index 2dbcddefd..10240b596 100644 --- a/view/photos_upload.tpl +++ b/view/photos_upload.tpl @@ -14,13 +14,16 @@ <div id="photos-upload-exist-end"></div> - <div id="photos-upload-perms" class="photos-upload-perms" ><div id="photos-upload-perms-menu" onClick="openClose('photos-upload-permissions-wrapper');" />$permissions</div> + <div id="photos-upload-perms" class="photos-upload-perms" > + <a href="#photos-upload-permissions-wrapper" id="photos-upload-perms-menu" /> + <span id="jot-perms-icon" class="icon $lockstate" ></span>$permissions + </a> <div id="photos-upload-perms-end"></div> - <div id="photos-upload-permissions-wrapper" style="display: none;" > - - $aclselect - + <div style="display: none;"> + <div id="photos-upload-permissions-wrapper"> + $aclselect + </div> </div> <div id="photos-upload-spacer"></div> @@ -32,3 +35,9 @@ <div class="photos-upload-end" ></div> </form> +<script> + $("a#photos-upload-perms-menu").fancybox({ + 'transitionIn' : 'none', + 'transitionOut' : 'none' + }); +</script> diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index fbeab2321..6a909bc7d 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -1483,10 +1483,17 @@ input#dfrn-url { width: 180px; } +#profile-jot-text { + height: 20px; + color:#cccccc; + border: 1px solid #cccccc; +} + + /** acl **/ +#photos-upload-permissions-wrapper, #profile-jot-acl-wrapper{ - overflow:hidden; - height: 100%; + display:block!important; } #acl-wrapper { diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index 2bd72ddbf..96702d320 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -1561,12 +1561,20 @@ padding: 5px 10px 0px; overflow: auto; } +#profile-jot-text { + height: 20px; + color:#cccccc; + border: 1px solid #cccccc; +} + + /** acl **/ +#photos-upload-permissions-wrapper, #profile-jot-acl-wrapper{ - overflow:hidden; - height: 100%; + display:block!important; } + #acl-wrapper { width: 690px; float:left; |