commit ef7f9f35b2c07401ba92baccf8fc0d5b6d451b31
parent 5ff07ce79210bf8e034286fe733d426526e34a88
Author: dankert <devnull@localhost>
Date: Sun, 22 Mar 2009 15:52:26 +0100
Auslagern von Javascript in eigene Datei.
Diffstat:
6 files changed, 41 insertions(+), 39 deletions(-)
diff --git a/themes/default/include/elements.ini.php b/themes/default/include/elements.ini.php
@@ -21,7 +21,7 @@ if = equals,value,invert,not,empty,present,contains,greaterthan,lessthan,t
image = config,file,url,icon,align:left,type,elementtype,fileext,tree
input = class:,default:,type:text,index,name:*,prefix,value,size:40,maxlength:256,onchange:,readonly:false
inputarea= name,rows:10,cols:40,value,index,onchange,prefix,class:,default:
-insert = file:*
+insert = file,script
label = for:*,value
fieldset = title
link = title:,config,target:_self,var,url,class:,action,subaction,id,var1,value1,var2,value2,var3,value3,var4,value4,var5,value5,accesskey,name,anchor
diff --git a/themes/default/include/html/insert.inc.php b/themes/default/include/html/insert.inc.php
@@ -1 +1,8 @@
-<?php include( $tpl_dir.basename($attr_file).'.tpl.php') ?>-
\ No newline at end of file
+
+/* #IF-ATTR file# */
+<?php include( $tpl_dir.basename($attr_file ).'.tpl.php'); ?>
+/* #END-IF# */
+
+/* #IF-ATTR script# */
+<script src="<?php echo OR_THEMES_DIR.$conf['interface']['theme'].'/js/'.basename($attr_script).'.js' ?>" type="text/javascript"></script>
+/* #END-IF# */
diff --git a/themes/default/js/mark.js b/themes/default/js/mark.js
@@ -0,0 +1,27 @@
+
+function mark()
+{
+ for( i=0; i<document.forms[0].elements.length; i++ )
+ {
+ if (document.forms[0].elements[i].type=='checkbox')
+ document.forms[0].elements[i].checked=true;
+ }
+}
+
+function unmark()
+{
+ for( i=0; i<document.forms[0].elements.length; i++ )
+ {
+ if (document.forms[0].elements[i].type=='checkbox')
+ document.forms[0].elements[i].checked=false;
+ }
+}
+
+function flip()
+{
+ for( i=0; i<document.forms[0].elements.length; i++ )
+ {
+ if (document.forms[0].elements[i].type=='checkbox')
+ document.forms[0].elements[i].checked=!document.forms[0].elements[i].checked;
+ }
+}
diff --git a/themes/default/js/screenwidth.js b/themes/default/js/screenwidth.js
@@ -0,0 +1 @@
+document.forms[0].screenwidth.value=window.innerWidth;
diff --git a/themes/default/templates/folder/select.tpl.src.php b/themes/default/templates/folder/select.tpl.src.php
@@ -53,32 +53,5 @@ page
row
cell class:fx colspan:2
text text:GLOBAL_NOT_FOUND
- dummy
-
-RAW
-<script name="JavaScript" type="text/javascript">
-<!--
-function mark()
-{
-<?php foreach( array_keys($object) as $id ) { ?>
-document.forms[0].obj<?php echo $id ?>.checked=true;
-<?php } ?>
-}
-function unmark()
-{
-<?php foreach( array_keys($object) as $id ) { ?>
-document.forms[0].obj<?php echo $id ?>.checked=false;
-<?php } ?>
-}
-function flip()
-{
-<?php foreach( array_keys($object) as $id ) { ?>
-if (document.forms[0].obj<?php echo $id ?>.checked==false)
- document.forms[0].obj<?php echo $id ?>.checked=true;
-else document.forms[0].obj<?php echo $id ?>.checked=false;
-<?php } ?>
-}
-//-->
-</script>
-END
-
+ insert script:mark
+ +
\ No newline at end of file
diff --git a/themes/default/templates/index/showlogin.tpl.src.php b/themes/default/templates/index/showlogin.tpl.src.php
@@ -92,13 +92,7 @@ page
row
cell colspan:2 class:act
button type:ok
-RAW
-<script name="javascript1.2" type="text/javascript">
-<!--
-document.forms[0].screenwidth.value=window.innerWidth;
-// -->
-</script>
-END
+ insert script:screenwidth
if value:size:dbids lessthan:2
hidden name:dbid default:var:actdbid
hidden name:objectid