mirror of
https://github.com/owncloud/bookmarks.git
synced 2024-12-01 05:24:11 +01:00
Move inline JS to external file
This commit is contained in:
parent
2022d42052
commit
e1a50b1737
30
js/full_tags.php
Normal file
30
js/full_tags.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2013 Lukas Reschke <lukas@statuscode.ch>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or
|
||||||
|
* later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Set the content type to Javascript
|
||||||
|
header("Content-type: text/javascript");
|
||||||
|
|
||||||
|
// Disallow caching
|
||||||
|
header("Cache-Control: no-cache, must-revalidate");
|
||||||
|
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
|
||||||
|
|
||||||
|
$qtags = OC_Bookmarks_Bookmarks::findTags(array(), 0, 400);
|
||||||
|
$tags = array();
|
||||||
|
foreach($qtags as $tag) {
|
||||||
|
$tags[] = $tag['tag'];
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
var fullTags = <?php echo json_encode($tags);?>;
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('body').bookmark_dialog({
|
||||||
|
'on_success': function(){
|
||||||
|
self.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
@ -1,13 +1,7 @@
|
|||||||
<form class="addBm" method="post" action="<?php echo OCP\Util::linkTo('bookmarks', 'ajax/editBookmark.php');?>">
|
<form class="addBm" method="post" action="<?php echo OCP\Util::linkTo('bookmarks', 'ajax/editBookmark.php');?>">
|
||||||
<?php if(!isset($embedded) || !$embedded):?>
|
<?php if(!isset($embedded) || !$embedded):?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript" src="<?php echo OC_Helper::linkTo('bookmarks/js', 'full_tags.php');?>"></script>
|
||||||
var fullTags = <?php echo $_['tags'];?>;
|
|
||||||
$(document).ready(function() {
|
|
||||||
$('body').bookmark_dialog({
|
|
||||||
'on_success': function(){ self.close(); }
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<h1><?php echo $l->t('Add a bookmark');?></h1>
|
<h1><?php echo $l->t('Add a bookmark');?></h1>
|
||||||
<div class="close_btn">
|
<div class="close_btn">
|
||||||
<a href="javascript:self.close()" class="ui-icon ui-icon-closethick">
|
<a href="javascript:self.close()" class="ui-icon ui-icon-closethick">
|
||||||
|
@ -59,9 +59,8 @@ function bookmarklet(){
|
|||||||
</div>
|
</div>
|
||||||
<div class="bookmarks_list"></div>
|
<div class="bookmarks_list"></div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script type="text/javascript" src="<?php echo OC_Helper::linkTo('bookmarks/js', 'full_tags.php');?>"></script>
|
||||||
var fullTags = <?php echo $_['tags'];?>;
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/html" id="edit_dialog_tmpl">
|
<script type="text/html" id="edit_dialog_tmpl">
|
||||||
<?php require 'addBm.php';?>
|
<?php require 'addBm.php';?>
|
||||||
|
Loading…
Reference in New Issue
Block a user