nitc :: PiwikScript
nitc :: PiwikScript :: _tracker_url
Piwik URL to use for this trackernitc :: PiwikScript :: defaultinit
nitc :: PiwikScript :: site_id=
Site ID used on Piwik systemnitc :: PiwikScript :: tracker_url=
Piwik URL to use for this trackernitc $ PiwikScript :: SELF
Type of this instance, automatically specialized in every classnitc $ PiwikScript :: rendering
Service used to render the content of the template.template :: Template :: _is_frozen
Is the template allowing more modification (add
)
template :: Template :: _is_writing
Flag to avoid infinite recursivity if a template contains itselftemplate :: Template :: _render_done
Flag to avoid multiple renderingnitc :: PiwikScript :: _tracker_url
Piwik URL to use for this trackercore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Writable :: defaultinit
template :: Template :: defaultinit
nitc :: PiwikScript :: defaultinit
core :: Object :: defaultinit
template :: Template :: is_frozen=
Is the template allowing more modification (add
)
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
template :: Template :: is_writing
Flag to avoid infinite recursivity if a template contains itselftemplate :: Template :: is_writing=
Flag to avoid infinite recursivity if a template contains itselfcore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).template :: Template :: render_done=
Flag to avoid multiple renderingnitc :: PiwikScript :: site_id=
Site ID used on Piwik systemnitc :: PiwikScript :: tracker_url=
Piwik URL to use for this trackercore :: Writable :: write_to_bytes
Likewrite_to
but return a new Bytes (may be quite large)
core :: Writable :: write_to_file
Likewrite_to
but take care of creating the file
core :: Writable :: write_to_string
Likewrite_to
but return a new String (may be quite large).
# JS script for Piwik Tracker
class PiwikScript
super Template
# Piwik URL to use for this tracker
var tracker_url: String
# Site ID used on Piwik system
var site_id: String
redef fun rendering do
addn "<script>"
var site_id = self.site_id.to_json
var tracker_url = self.tracker_url.trim
if tracker_url.chars.last != '/' then tracker_url += "/"
tracker_url = "://{tracker_url}".to_json
addn "<!-- Piwik -->"
addn "var _paq = _paq || [];"
addn " _paq.push([\"trackPageView\"]);"
addn " _paq.push([\"enableLinkTracking\"]);"
addn "(function() \{"
addn " var u=((\"https:\" == document.location.protocol) ? \"https\" : \"http\") + {tracker_url};"
addn " _paq.push([\"setTrackerUrl\", u+\"piwik.php\"]);"
addn " _paq.push([\"setSiteId\", {site_id}]);"
addn " var d=document, g=d.createElement(\"script\"), s=d.getElementsByTagName(\"script\")[0]; g.type=\"text/javascript\";"
addn " g.defer=true; g.async=true; g.src=u+\"piwik.js\"; s.parentNode.insertBefore(g,s);"
addn "\})();"
addn "</script>"
end
end
src/doc/static/static_html.nit:330,1--362,3