Dotclear

Changeset 1252:0bb48ee94f05


Ignore:
Timestamp:
07/24/13 16:51:13 (12 years ago)
Author:
Nicolas Lœuillet <nicolas@…>
Branch:
tags_links_in_page
Children:
1253:0f0cf6a5df47, 1409:808b5fe32fbf
Message:

unminified js

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/tags/js/page.js

    r1239 r1240  
    1  
    2 $(function(){$('#edit-entry').onetabload(function(){var tags_edit=$('#tags-edit');var post_id=$('#id');var meta_field=null;if(tags_edit.length>0){post_id=(post_id.length>0)?post_id.get(0).value:false;if(post_id==false){meta_field=$('<input type="hidden" name="post_tags" />');meta_field.val($('#post_tags').val());} 
    3 var mEdit=new metaEditor(tags_edit,meta_field,'tag');mEdit.meta_url='plugin.php?p=tags&m=tag_posts&amp;tag=';mEdit.displayMeta('tag',post_id);window.dc_tag_editor=mEdit;}});});jsToolBar.prototype.elements.tagSpace={type:'space'};jsToolBar.prototype.elements.tag={type:'button',title:'Keyword',fn:{}};jsToolBar.prototype.elements.tag.context='post';jsToolBar.prototype.elements.tag.icon='index.php?pf=tags/img/tag-add.png';jsToolBar.prototype.elements.tag.fn.wiki=function(){this.encloseSelection('','',function(str){if(str==''){window.alert(dotclear.msg.no_selection);return'';} 
    4 if(str.indexOf(',')!=-1){return str;}else{return'['+str+'|tag:'+str+']';}});};jsToolBar.prototype.elements.tag.fn.xhtml=function(){var url=this.elements.tag.url;this.encloseSelection('','',function(str){if(str==''){window.alert(dotclear.msg.no_selection);return'';} 
    5 if(str.indexOf(',')!=-1){return str;}else{return'<a href="'+this.stripBaseURL(url+'/'+str)+'">'+str+'</a>';}});};jsToolBar.prototype.elements.tag.fn.wysiwyg=function(){var t=this.getSelectedText();if(t==''){window.alert(dotclear.msg.no_selection);return;} 
    6 if(t.indexOf(',')!=-1){return;} 
    7 var n=this.getSelectedNode();var a=document.createElement('a');a.href=this.stripBaseURL(this.elements.tag.url+'/'+t);a.appendChild(n);this.insertNode(a);}; 
     1$(function () { 
     2    $('#edit-entry').onetabload(function () { 
     3        var tags_edit = $('#tags-edit'); 
     4        var post_id = $('#id'); 
     5        var meta_field = null; 
     6        if (tags_edit.length > 0) { 
     7            post_id = (post_id.length > 0) ? post_id.get(0).value : false; 
     8            if (post_id == false) { 
     9                meta_field = $('<input type="hidden" name="post_tags" />'); 
     10                meta_field.val($('#post_tags').val()); 
     11            } 
     12            var mEdit = new metaEditor(tags_edit, meta_field, 'tag'); 
     13            mEdit.meta_url = 'plugin.php?p=tags&m=tag_posts&amp;tag='; 
     14            mEdit.displayMeta('tag', post_id); 
     15            window.dc_tag_editor = mEdit; 
     16        } 
     17    }); 
     18}); 
     19jsToolBar.prototype.elements.tagSpace = { 
     20    type: 'space' 
     21}; 
     22jsToolBar.prototype.elements.tag = { 
     23    type: 'button', 
     24    title: 'Keyword', 
     25    fn: {} 
     26}; 
     27jsToolBar.prototype.elements.tag.context = 'post'; 
     28jsToolBar.prototype.elements.tag.icon = 'index.php?pf=tags/img/tag-add.png'; 
     29jsToolBar.prototype.elements.tag.fn.wiki = function () { 
     30    this.encloseSelection('', '', function (str) { 
     31        if (str == '') { 
     32            window.alert(dotclear.msg.no_selection); 
     33            return ''; 
     34        } 
     35        if (str.indexOf(',') != -1) { 
     36            return str; 
     37        } else { 
     38            return '[' + str + '|tag:' + str + ']'; 
     39        } 
     40    }); 
     41}; 
     42jsToolBar.prototype.elements.tag.fn.xhtml = function () { 
     43    var url = this.elements.tag.url; 
     44    this.encloseSelection('', '', function (str) { 
     45        if (str == '') { 
     46            window.alert(dotclear.msg.no_selection); 
     47            return ''; 
     48        } 
     49        if (str.indexOf(',') != -1) { 
     50            return str; 
     51        } else { 
     52            return '<a href="' + this.stripBaseURL(url + '/' + str) + '">' + str + '</a>'; 
     53        } 
     54    }); 
     55}; 
     56jsToolBar.prototype.elements.tag.fn.wysiwyg = function () { 
     57    var t = this.getSelectedText(); 
     58    if (t == '') { 
     59        window.alert(dotclear.msg.no_selection); 
     60        return; 
     61    } 
     62    if (t.indexOf(',') != -1) { 
     63        return; 
     64    } 
     65    var n = this.getSelectedNode(); 
     66    var a = document.createElement('a'); 
     67    a.href = this.stripBaseURL(this.elements.tag.url + '/' + t); 
     68    a.appendChild(n); 
     69    this.insertNode(a); 
     70}; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map