Overview
Comment:Corrections pour SkrivML + ouverture pop-up images et fichiers (wiki)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f5a5566aa75dd92f4490efb4d27f297363329890
User & Date: bohwaz on 2015-02-04 02:47:37
Other Links: manifest | tags
Context
2015-02-04
02:48
possibilité d'indiquer si un fichier est une image, ça simplifiera les galeries dans le wiki check-in: 6ea3fe6cbb user: bohwaz tags: trunk
02:47
Corrections pour SkrivML + ouverture pop-up images et fichiers (wiki) check-in: f5a5566aa7 user: bohwaz tags: trunk
02:31
Stocker la différence sans absolu check-in: 166dfb5539 user: bohwaz tags: trunk
Changes

Modified src/templates/admin/wiki/editer.tpl from [600215e4b9] to [b5cdf0d26a].

103
104
105
106
107
108
109

110
111
112
113
114
115
116
        </dl>
    </fieldset>

    <p class="submit">
        {csrf_field key="wiki_edit_`$page.id`"}
        <input type="hidden" name="revision_edition" value="{form_field name=revision_edition default=$page.revision}" />
        <input type="hidden" name="debut_edition" value="{form_field name=debut_edition default=$time}" />

        <input type="submit" name="save" value="Enregistrer &rarr;" />
    </p>

</form>

<script type="text/javascript">
var page_id = '{$page.id|escape}';







>







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
        </dl>
    </fieldset>

    <p class="submit">
        {csrf_field key="wiki_edit_`$page.id`"}
        <input type="hidden" name="revision_edition" value="{form_field name=revision_edition default=$page.revision}" />
        <input type="hidden" name="debut_edition" value="{form_field name=debut_edition default=$time}" />
        <input id="f_id" value="{$page.id|escape}" type="hidden" />
        <input type="submit" name="save" value="Enregistrer &rarr;" />
    </p>

</form>

<script type="text/javascript">
var page_id = '{$page.id|escape}';

Modified src/www/admin/static/wikitoolbar.js from [bdb0e666ea] to [50eede56f9].

75
76
77
78
79
80
81












82
83
84
85
86
87
88
..
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110









111
112
113
114
115
116
117
118
119
120
121
122
123
			var selection =  this.replace(e, left_str + the_sel_text + right_str );
			if(sel_offset !== undefined && sel_length !== undefined) selection = this.set(e, selection.start +  sel_offset, selection.start +  sel_offset + sel_length);
			else if(the_sel_text == '') selection = this.set(e, selection.start + left_str.length, selection.start + left_str.length);
			e.scrollTop = scroll;
			return selection;
		}
	};













	function launchToolbar()
	{
		function addBtn(className, label, action)
		{
			var btn = document.createElement('input');
			btn.type = 'button';
................................................................................
		}

		var txt = document.getElementById('f_contenu');
		var parent = txt.parentNode.parentNode;
		var toolbar = document.createElement('div');
		toolbar.className = "toolbar";

		addBtn('title', 'Titre', function () { selection.wrap(txt, '{{{', "}}}\n"); } );
		addBtn('italic', 'Italique', function () { selection.wrap(txt, '{', '}'); } );
		addBtn('bold', 'Gras', function () { selection.wrap(txt, '{{', '}}'); } );
		addBtn('strike', 'Barré', function () { selection.wrap(txt, '<del>', '</del>'); } );
		addBtn('code', 'Chasse fixe', function () { selection.wrap(txt, '<pre>', '</pre>'); } );
		addBtn('link', 'Lien', function () {
				if (url = window.prompt('Adresse du lien ?'))
				{
						selection.wrap(txt, '[', '->' + url + ']');
				}
			} );










		parent.insertBefore(toolbar, txt.parentNode);
	}

	if (document.addEventListener)
	{
		document.addEventListener("DOMContentLoaded", launchToolbar, false);
	}
	else
	{
		document.attachEvent("onDOMContentLoaded", launchToolbar);
	}
} () );







>
>
>
>
>
>
>
>
>
>
>
>







 







|
|
|
|
|



|


>
>
>
>
>
>
>
>
>













75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
...
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
			var selection =  this.replace(e, left_str + the_sel_text + right_str );
			if(sel_offset !== undefined && sel_length !== undefined) selection = this.set(e, selection.start +  sel_offset, selection.start +  sel_offset + sel_length);
			else if(the_sel_text == '') selection = this.set(e, selection.start + left_str.length, selection.start + left_str.length);
			e.scrollTop = scroll;
			return selection;
		}
	};

	function openImageBrowser()
	{
		window.open('_images.php?page=' + document.getElementById('f_id').value, 'browseImages',
            'width=500,height=600,top=150,left=150,scrollbars=1,location=false');
	}

	function openFileBrowser()
	{
		window.open('_fichiers.php?page=' + document.getElementById('f_id').value, 'browseFiles',
            'width=500,height=600,top=150,left=150,scrollbars=1,location=false');
	}

	function launchToolbar()
	{
		function addBtn(className, label, action)
		{
			var btn = document.createElement('input');
			btn.type = 'button';
................................................................................
		}

		var txt = document.getElementById('f_contenu');
		var parent = txt.parentNode.parentNode;
		var toolbar = document.createElement('div');
		toolbar.className = "toolbar";

		addBtn('title', 'Titre', function () { selection.wrap(txt, '=== ', " ===\n"); } );
		addBtn('italic', 'Italique', function () { selection.wrap(txt, "''", "''"); } );
		addBtn('bold', 'Gras', function () { selection.wrap(txt, '**', '**'); } );
		addBtn('strike', 'Barré', function () { selection.wrap(txt, '--', '--'); } );
		addBtn('code', 'Chasse fixe', function () { selection.wrap(txt, "[[[\n", "\n]]]"); } );
		addBtn('link', 'Lien', function () {
				if (url = window.prompt('Adresse du lien ?'))
				{
						selection.wrap(txt, '[[', ' | ' + url + ']]');
				}
			} );

		addBtn('image', 'Image', function () {
			window.open('_images.php?page=' + document.getElementById('f_id').value, 'browseImages',
            	'width=500,height=600,top=150,left=150,scrollbars=1,location=false');
		});
		addBtn('file', 'Fichier', function () {
			window.open('_fichiers.php?page=' + document.getElementById('f_id').value, 'browseFiles',
            	'width=500,height=600,top=150,left=150,scrollbars=1,location=false');
		});

		parent.insertBefore(toolbar, txt.parentNode);
	}

	if (document.addEventListener)
	{
		document.addEventListener("DOMContentLoaded", launchToolbar, false);
	}
	else
	{
		document.attachEvent("onDOMContentLoaded", launchToolbar);
	}
} () );